Firstly asked at: https://github.com/weidai11/cryptopp/issues/651
As the title says, everything failing to build. I have this code (below), and I'm not able to build it (logs below the code). I use CMake to create the Visual Studio solution file. I also tried version 6.1.0 and 6.0.0, same problem occurs.
Steps to build CryptoPP: download CryptoPP source code (from website) -> open cryptest.sln -> Retarget solution (to use my version of Windows SDK - 10.0.16299.0) -> Ok -> Batch Build -> tick cryptlib - Release|Win32 -> Build
cryptopp-test.cpp:
https://gist.github.com/zavodnyrichard/f51ec376cda91c9732ac822bab26189b#file-cryptopp-test-cpp
CMakeLists.txt:
https://gist.github.com/zavodnyrichard/f51ec376cda91c9732ac822bab26189b#file-cmakelists-txt
$cmake ..
https://gist.github.com/zavodnyrichard/f51ec376cda91c9732ac822bab26189b#file-cmake
$msbuild cryptopp-test.sln
However if I'll try to build this code (below) using the same steps (and CMakeList.txt) as above, everything is fine.
| C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.13.26128\bin\HostX86\x86\link.exe /ERR |
| ORREPORT:QUEUE /OUT:"E:\projects\cpp-utils\cryptopp-test\build\Debug\cryptopp-test.exe" /INCREMENTAL /NOLOGO kernel32 |
| .lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFES |
| T /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"E:/projects/cpp-utils/cryptopp-test/ |
| build/Debug/cryptopp-test.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"E:/projects/cpp-utils/cryp |
| topp-test/build/Debug/cryptopp-test.lib" /MACHINE:X86 /SAFESEH /machine:X86 "cryptopp-test.dir\Debug\cryptopp-test.o |
| Link: |
cmake_minimum_required(VERSION 3.10.0)
project(cryptopp-test)
add_executable(cryptopp-test cryptopp-test.cpp)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
#search for CryptoPP and include it
set(CRYPTOPP_ROOT_DIR "C:\\libs\\cryptopp700\\cryptopp\\Win32\\Output\\Debug\\cryptlib.lib")
set(CRYPTOPP_LIBRARY "C:\\libs\\cryptopp700\\cryptopp\\Win32\\Output\\Debug\\cryptlib.lib")
set(CRYPTOPP_INCLUDE_DIR "C:\\libs\\cryptopp700")
find_package(CryptoPP REQUIRED)
if(CRYPTOPP_FOUND)
target_link_libraries(cryptopp-test ${CRYPTOPP_LIBRARIES})
include_directories(${CRYPTOPP_INCLUDE_DIRS})
endif()
#--