Я пытаюсь создать и связать NGHTTP2 с проектом C ++, и, хотя компиляция отлично работает на Linux, в Windows с MSVC2020 он не может построить.
cmake-build-release\_deps\nghttp2-src\lib\nghttp2_pq.c(80): error C2440: '=': cannot convert from 'void *' to 'nghttp2_pq_entry **'
< /code>
Я исправил большинство ошибок со следующими параметрами компиляции, пока не застрял на вышеуказанном. < /p>
if(MSVC)
add_compile_options(
/permissive-
/Zc:__cplusplus
)
add_compile_options(/TP)
endif()
find_package(Qt6 COMPONENTS
Core
Gui
Widgets
Network
REQUIRED)
find_package(ZLIB REQUIRED)
# FetchContent for dependencies
include(FetchContent)
FetchContent_Declare(Qlementine
GIT_REPOSITORY "https://github.com/oclero/qlementine.git"
)
set(ENABLE_LIB_ONLY ON CACHE BOOL "Build libnghttp2 only")
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Don't build shared libraries")
set(BUILD_STATIC_LIBS ON CACHE BOOL "Build static libraries")
set(ENABLE_APP OFF CACHE BOOL "Disable applications")
set(ENABLE_HPACK_TOOLS OFF CACHE BOOL "Disable HPACK tools")
set(ENABLE_EXAMPLES OFF CACHE BOOL "Disable examples")
set(ENABLE_DOC OFF CACHE BOOL "Disable documentation")
set(BUILD_TESTING OFF CACHE BOOL "Disable testing")
set(ENABLE_FAILMALLOC OFF CACHE BOOL "Disable failmalloc test program")
FetchContent_Declare(nghttp2
GIT_REPOSITORY "https://github.com/nghttp2/nghttp2.git"
GIT_TAG "v1.66.0"
)
set(ENABLE_LIB_ONLY ON CACHE BOOL "Build libnghttp2 only")
set(ENABLE_STATIC_LIB ON CACHE BOOL "Build static library")
set(ENABLE_SHARED_LIB OFF CACHE BOOL "Build shared library")
FetchContent_MakeAvailable(Qlementine nghttp2)
Подробнее здесь: https://stackoverflow.com/questions/797 ... -with-msvc
Не удается скомпилировать nghttp2 static с проектом QT C ++ с MSVC ⇐ C++
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение