Fail to build in windows 10 x64 due to openssl
dongeronimo opened this issue · 4 comments
dongeronimo commented
Steps to reproduce:
- in developer prompt for visual studio 2022:
git clone https://github.com/microsoft/vcpkg
.\vcpkg\bootstrap-vcpkg.bat
- clone GameNetworkingSockets repo.
- in GameNetworkingSockets dir:
.\vcpkg\vcpkg install --triplet=x64-windows
cmake -S . -B build -G Ninja
Fails with
-- 'CMAKE_CXX_FLAGS_RELWITHDEBINFO': /MD /Zi /O2 /Ob1 /DNDEBUG
--
-- OPENSSL_INCLUDE_DIR = C:/Program Files/OpenSSL-Win64/include
CMake Error at CMakeLists.txt:119 (message):
Cannot find EVP_MD_CTX_free in OpenSSL headers/libs for the target
architecture. Check that you're using OpenSSL 1.1.0 or later.
Openssl version installed is 3.1
dongeronimo commented
The whole output:
Fetching registry information from https://github.com/microsoft/vcpkg (HEAD)...
Detecting compiler hash for triplet x64-windows...
A suitable version of powershell-core was not found (required v7.2.11) Downloading portable powershell-core 7.2.11...
Downloading powershell-core...
https://github.com/PowerShell/PowerShell/releases/download/v7.2.11/PowerShell-7.2.11-win-x86.zip->C:\Users\lucia\AppData\Local\vcpkg\downloads\PowerShell-7.2.11-win-x86.zip
Downloading https://github.com/PowerShell/PowerShell/releases/download/v7.2.11/PowerShell-7.2.11-win-x86.zip
Extracting powershell-core...
The following packages will be built and installed:
openssl:x64-windows -> 3.2.1 -- C:\Users\lucia\AppData\Local\vcpkg\registries\git-trees\53fb72a19981a3439cd569f58b722ca6cd26e23d
protobuf:x64-windows -> 3.21.12#1 -- C:\Users\lucia\AppData\Local\vcpkg\registries\git-trees\8d742753b6c35666168a4178f0aae986740ae42c
* vcpkg-cmake:x64-windows -> 2023-05-04 -- C:\Users\lucia\AppData\Local\vcpkg\registries\git-trees\88a7058fc7fa73a9c4c99cfcae9d79e2abf87a5a
* vcpkg-cmake-config:x64-windows -> 2022-02-06#1 -- C:\Users\lucia\AppData\Local\vcpkg\registries\git-trees\8d54cc4f487d51b655abec5f9c9c3f86ca83311f
* vcpkg-cmake-get-vars:x64-windows -> 2023-12-31 -- C:\Users\lucia\AppData\Local\vcpkg\registries\git-trees\725c841810ceb8de33da68ea879eb8f0b4d6c94c
Additional packages (*) will be modified to complete this operation.
A suitable version of 7zip was not found (required v23.1.0) Downloading portable 7zip 23.1.0...
Downloading 7zip...
https://www.7-zip.org/a/7z2301-extra.7z->C:\Users\lucia\AppData\Local\vcpkg\downloads\7z2301-extra.7z
Downloading https://www.7-zip.org/a/7z2301-extra.7z
Extracting 7zip...
Restored 0 package(s) from C:\Users\lucia\AppData\Local\vcpkg\archives in 994 us. Use --debug to see more details.
Installing 1/5 vcpkg-cmake:x64-windows...
Building vcpkg-cmake:x64-windows...
-- Installing port from location: C:\Users\lucia\AppData\Local\vcpkg\registries\git-trees\88a7058fc7fa73a9c4c99cfcae9d79e2abf87a5a
-- Installing: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg_cmake_configure.cmake
-- Installing: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake
-- Installing: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg_cmake_install.cmake
-- Installing: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/vcpkg-cmake_x64-windows/share/vcpkg-cmake/vcpkg-port-config.cmake
-- Installing: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/vcpkg-cmake_x64-windows/share/vcpkg-cmake/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 66.1 ms.
Elapsed time to handle vcpkg-cmake:x64-windows: 169 ms
Installing 2/5 vcpkg-cmake-get-vars:x64-windows...
Building vcpkg-cmake-get-vars:x64-windows...
-- Installing port from location: C:\Users\lucia\AppData\Local\vcpkg\registries\git-trees\725c841810ceb8de33da68ea879eb8f0b4d6c94c
-- Installing: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/vcpkg-cmake-get-vars_x64-windows/share/vcpkg-cmake-get-vars/vcpkg_cmake_get_vars.cmake
-- Installing: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/vcpkg-cmake-get-vars_x64-windows/share/vcpkg-cmake-get-vars/cmake_get_vars
-- Installing: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/vcpkg-cmake-get-vars_x64-windows/share/vcpkg-cmake-get-vars/cmake_get_vars/CMakeLists.txt
-- Installing: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/vcpkg-cmake-get-vars_x64-windows/share/vcpkg-cmake-get-vars/vcpkg-port-config.cmake
-- Installing: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/vcpkg-cmake-get-vars_x64-windows/share/vcpkg-cmake-get-vars/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 39 ms.
Elapsed time to handle vcpkg-cmake-get-vars:x64-windows: 117 ms
Installing 3/5 vcpkg-cmake-config:x64-windows...
Building vcpkg-cmake-config:x64-windows...
-- Installing port from location: C:\Users\lucia\AppData\Local\vcpkg\registries\git-trees\8d54cc4f487d51b655abec5f9c9c3f86ca83311f
-- Installing: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/vcpkg-cmake-config_x64-windows/share/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake
-- Installing: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/vcpkg-cmake-config_x64-windows/share/vcpkg-cmake-config/vcpkg-port-config.cmake
-- Installing: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/vcpkg-cmake-config_x64-windows/share/vcpkg-cmake-config/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 40.6 ms.
Elapsed time to handle vcpkg-cmake-config:x64-windows: 113 ms
Installing 4/5 openssl:x64-windows...
Building openssl:x64-windows...
-- Installing port from location: C:\Users\lucia\AppData\Local\vcpkg\registries\git-trees\53fb72a19981a3439cd569f58b722ca6cd26e23d
-- Downloading https://github.com/openssl/openssl/archive/openssl-3.2.1.tar.gz -> openssl-openssl-openssl-3.2.1.tar.gz...
-- Extracting source C:/Users/lucia/AppData/Local/vcpkg/downloads/openssl-openssl-openssl-3.2.1.tar.gz
-- Applying patch script-prefix.patch
-- Applying patch windows/install-layout.patch
-- Applying patch windows/install-pdbs.patch
-- Applying patch unix/android-cc.patch
-- Applying patch unix/move-openssldir.patch
-- Applying patch unix/no-empty-dirs.patch
-- Applying patch unix/no-static-libs-for-shared.patch
-- Using source at C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/blds/openssl/src/nssl-3.2.1-8707343470.clean
-- Downloading https://strawberryperl.com/download/5.32.1.1/strawberry-perl-5.32.1.1-32bit.zip -> strawberry-perl-5.32.1.1-32bit.zip...
-- Found external ninja('1.11.0').
-- Getting CMake variables for x64-windows
-- Downloading https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/win64/nasm-2.16.01-win64.zip;https://gstreamer.freedesktop.org/src/mirror/nasm-2.16.01-win64.zip -> nasm-2.16.01-win64.zip...
-- Getting CMake variables for x64-windows
-- Downloading https://download.qt.io/official_releases/jom/jom_1_1_3.zip;https://mirrors.ocf.berkeley.edu/qt/official_releases/jom/jom_1_1_3.zip -> jom_1_1_3.zip...
-- Prerunning x64-windows-dbg
-- Building x64-windows-dbg
-- Prerunning x64-windows-rel
-- Building x64-windows-rel
-- Fixing pkgconfig file: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/openssl_x64-windows/lib/pkgconfig/libcrypto.pc
-- Fixing pkgconfig file: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/openssl_x64-windows/lib/pkgconfig/libssl.pc
-- Fixing pkgconfig file: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/openssl_x64-windows/lib/pkgconfig/openssl.pc
-- Downloading https://mirror.msys2.org/mingw/mingw32/mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst;https://repo.msys2.org/mingw/mingw32/mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/mingw/mingw32/mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/mingw/mingw32/mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/mingw/mingw32/mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst;https://mirror.selfnet.de/msys2/mingw/mingw32/mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst -> mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst...
-- Downloading https://mirror.msys2.org/msys/x86_64/msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst;https://repo.msys2.org/msys/x86_64/msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst;https://mirror.yandex.ru/mirrors/msys2/msys/x86_64/msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst;https://mirrors.tuna.tsinghua.edu.cn/msys2/msys/x86_64/msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst;https://mirrors.ustc.edu.cn/msys2/msys/x86_64/msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst;https://mirror.selfnet.de/msys2/msys/x86_64/msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst -> msys2-msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst...
-- Using msys root at C:/Users/lucia/AppData/Local/vcpkg/downloads/tools/msys2/6f3fa1a12ef85a6f
-- Fixing pkgconfig file: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/openssl_x64-windows/debug/lib/pkgconfig/libcrypto.pc
-- Fixing pkgconfig file: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/openssl_x64-windows/debug/lib/pkgconfig/libssl.pc
-- Fixing pkgconfig file: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/openssl_x64-windows/debug/lib/pkgconfig/openssl.pc
-- Installing: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/openssl_x64-windows/share/openssl/usage
-- Installing: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/openssl_x64-windows/share/openssl/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 2.3 s.
Elapsed time to handle openssl:x64-windows: 6.4 min
Installing 5/5 protobuf:x64-windows...
Building protobuf:x64-windows...
-- Installing port from location: C:\Users\lucia\AppData\Local\vcpkg\registries\git-trees\8d742753b6c35666168a4178f0aae986740ae42c
-- Downloading https://github.com/protocolbuffers/protobuf/archive/v3.21.12.tar.gz -> protocolbuffers-protobuf-v3.21.12.tar.gz...
-- Extracting source C:/Users/lucia/AppData/Local/vcpkg/downloads/protocolbuffers-protobuf-v3.21.12.tar.gz
-- Applying patch fix-static-build.patch
-- Applying patch fix-default-proto-file-path.patch
-- Applying patch compile_options.patch
-- Using source at C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/blds/protobuf/src/v3.21.12-fdb7676342.clean
-- Found external ninja('1.11.0').
-- Configuring x64-windows
-- Building x64-windows-dbg
-- Building x64-windows-rel
-- Fixing pkgconfig file: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/protobuf_x64-windows/lib/pkgconfig/protobuf-lite.pc
-- Fixing pkgconfig file: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/protobuf_x64-windows/lib/pkgconfig/protobuf.pc
-- Using cached mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst.
-- Using cached msys2-msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst.
-- Using msys root at C:/Users/lucia/AppData/Local/vcpkg/downloads/tools/msys2/6f3fa1a12ef85a6f
-- Fixing pkgconfig file: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/protobuf_x64-windows/debug/lib/pkgconfig/protobuf-lite.pc
-- Fixing pkgconfig file: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/protobuf_x64-windows/debug/lib/pkgconfig/protobuf.pc
-- Installing: C:/Users/lucia/programacao/GameNetworkingSockets/vcpkg_installed/vcpkg/pkgs/protobuf_x64-windows/share/protobuf/copyright
-- Performing post-build validation
Stored binaries in 1 destinations in 5.6 s.
Elapsed time to handle protobuf:x64-windows: 2.9 min
Total install time: 9.4 min
The package openssl is compatible with built-in CMake targets:
find_package(OpenSSL REQUIRED)
target_link_libraries(main PRIVATE OpenSSL::SSL OpenSSL::Crypto)
protobuf provides CMake targets:
# this is heuristically generated, and may not be correct
find_package(protobuf CONFIG REQUIRED)
target_link_libraries(main PRIVATE protobuf::libprotoc protobuf::libprotobuf protobuf::libprotobuf-lite)
C:\Users\lucia\programacao\GameNetworkingSockets>cmake -S . -B build -G Ninja
-- The C compiler identification is MSVC 19.38.33134.0
-- The CXX compiler identification is MSVC 19.38.33134.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx86/x86/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/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.38.33130/bin/Hostx86/x86/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_BUILD_TYPE='Debug'
-- MSVC -> forcing use of dynamically-linked runtime.
-- Initial build flags:
-- 'CMAKE_C_FLAGS_DEBUG': /MDd /Zi /Ob0 /Od /RTC1
-- 'CMAKE_C_FLAGS_MINSIZEREL': /MD /O1 /Ob1 /DNDEBUG
-- 'CMAKE_C_FLAGS_RELEASE': /MD /O2 /Ob2 /DNDEBUG
-- 'CMAKE_C_FLAGS_RELWITHDEBINFO': /MD /Zi /O2 /Ob1 /DNDEBUG
-- 'CMAKE_CXX_FLAGS_DEBUG': /MDd /Zi /Ob0 /Od /RTC1
-- 'CMAKE_CXX_FLAGS_MINSIZEREL': /MD /O1 /Ob1 /DNDEBUG
-- 'CMAKE_CXX_FLAGS_RELEASE': /MD /O2 /Ob2 /DNDEBUG
-- 'CMAKE_CXX_FLAGS_RELWITHDEBINFO': /MD /Zi /O2 /Ob1 /DNDEBUG
--
-- Looking for BCryptEncrypt
-- Looking for BCryptEncrypt - found
-- Found OpenSSL: C:/Program Files/OpenSSL-Win64/lib/libcrypto.lib (found version "3.1.2")
-- OPENSSL_INCLUDE_DIR = C:/Program Files/OpenSSL-Win64/include
-- Looking for EVP_MD_CTX_free
-- Looking for EVP_MD_CTX_free - not found
CMake Error at CMakeLists.txt:119 (message):
Cannot find EVP_MD_CTX_free in OpenSSL headers/libs for the target
architecture. Check that you're using OpenSSL 1.1.0 or later.
-- Configuring incomplete, errors occurred!
dongeronimo commented
tested in 3/20/2024 and it's solved.
Shadow-Master07 commented
Do you know how it is solved? I am currently struggling with the same problem.
dongeronimo commented
@Shadow-Master07 in March 20, last time I had to build the lib, I just followed the instructions on building with VCPKG in windows and it worked. Maybe it regressed? IDK because i haven't build it for some time