alibaba / xquic

XQUIC Library released by Alibaba is a cross-platform implementation of QUIC and HTTP/3 protocol.
Apache License 2.0
1.7k stars 327 forks source link

[Bug]:xquic在windows下编译有错误 #168

Closed ziguang89 closed 2 years ago

ziguang89 commented 2 years ago

What happened?

按照最新版本的xquic中的platforms中在win10 64位上编译xquic,一直都报错,无法解决

Steps To Reproduce

windows环境: Win10 64位系统

软件版本: Go:1.18.1 Cmake:3.23.1 Nasm:2.15 Visual studio:2017 因为环境不联网,没有办法下载安装vcpkg,从而libevent是自己离线安装的

编译步骤: (1) 编译boringssl 当前下载的是4.23号的master分支代码,使用的是vs2017下的命令行提示符 如果按照platforms下的命令运行, cmake -DCMAKE_GENERATOR_PLATFORM=x64 --config Debug -DBUILD_SHARED_LIBS=0 -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC" .. 会报错,cmake error:unknown argument --config:

将config命令去掉,成功不报错

设置 set GO111MODULE=off 运行MSBuild.exe ALL_BUILD.vcxproj,生成lib

(2) 编译xquic 运行命令: cmake -DSSL_TYPE=boringssl -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 15 2017 Win64" .. 不报错 继续运行: MSBuild.exe ALL_BUILD.vcxproj 会报一堆无法解析的错误 22

Relevant log output

No response

yuanbo-zhang commented 2 years ago

指定下加密库头文件和路径试下

yuanbo-zhang commented 2 years ago

指定下加密库头文件和路径试下

ziguang89 commented 2 years ago

是cmake -DSSL_TYPE=${SSL_TYPE_STR} -DSSL_PATH=${SSL_PATH_STR} -DSSL_INC_PATH=${SSL_INC_PATH_STR} -DSSL_LIB_PATH=${SSL_LIB_PATH_STR} .. 这个命令中ssl的路径么,我当前指定了下boringssl,lib和头文件路径什么的我看cmakelists里面是有对应写的,编译时看打印也是正确的,cmake打印如下: C:\share\wwt\xquic\build>cmake -DSSL_TYPE=boringssl -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 15 2017 Win64" .. CMake Deprecation Warning at CMakeLists.txt:3 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.

Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.

-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.15063. -- The C compiler identification is MSVC 19.16.27048.0 -- The CXX compiler identification is MSVC 19.16.27048.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done SSL_TYPE= boringssl SSL_PATH= C:/share/wwt/xquic/third_party/boringssl SSL_LIB_PATH= C:/share/wwt/xquic/third_party/boringssl/build/ssl/Debug/ssl.lib;C:/share/wwt/xquic/third_party/boringssl/build/crypto/Debug/crypto.lib SSL_INC_PATH= C:/share/wwt/xquic/third_party/boringssl/include CMAKE_C_FLAGS=/DWIN32 /D_WINDOWS /W3 -g -O2 -std=gnu11 -Wall -DNDEBUG_PRINT -DNPRINT_MALLOC -- Configuring done -- Generating done -- Build files have been written to: C:/share/wwt/xquic/build

yuanbo-zhang commented 2 years ago

Dear      您好,邮件我已收到 !BestwishThink's张渊博