Actually No files ending with "vc143-mt-s-x64-1_89.lib" exist in my Boost library, but still compiler tried to find 'libboost_program_options-vc143-mt-s-x64-1_89.lib'. I don't know why.
Here is the command line when I compiled Boost Library.↓
b2 toolset=msvc-14.3 address-model=64 variant=debug link=static threading=multi runtime-link=shared
CmakeLists↓
set(Boost_INCLUDE_DIR "E:/boost_1_89_0")
set(Boost_LIBRARY_DIR "E:/boost_1_89_0/stage/lib")
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.89.0 REQUIRED COMPONENTS log thread filesystem date_time program_options)
target_link_libraries(project_name
PRIVATE
${Boost_LIBRARIES}
)
CMakePresets.json↓
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"Boost_USE_STATIC_LIBS": "ON",
"Boost_USE_STATIC_RUNTIME": "OFF",
"Boost_USE_DEBUG_RUNTIME": "ON",
"Boost_USE_MULTITHREADED": "ON",
"Boost_USE_DEBUG_LIBS":"ON"
}
compiler : MSVC143 x64-Debug build Operating System: Windows 10
No files with suffix "vc143-mt-s-x64-1_89.lib" in Additional Dependencies setting either. All are ending with "vc143-mt-gd-x64-1_89.lib".
Any idea about this problem?
Since I solved it, let me share how to fix this issue.
At very beginning, I tried to install Boost library through vcpkg(i.e. vcpkg install boost). With this, both configure and build are working. But I got an error when this code↓ run. So I decided to complie boost by myself.
desc.add_options()("memory-lock", po::bool_switch()->default_value(false),"Lock memory pages to prevent swapping");
According to the command line used when compiling Boost manually, I updated my VS2022 settings↓.
1. Configuration Properties → Advanced → Use of MFC → Use MFC in a Static Library
2. Configuration Properties → Advanced → Use Debug Libraries → Yes
3. Configuration Properties → C/C++ → Code Generation → Runtime Library → Multi-threaded Debug DLL
Then no error comes out when building my project.
And I don't recommend using Boost Debug installed by vcpkg...