New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linker error when building examples using cmake in Visual Studio 2019 #53
Comments
Thank you @chrisabr
|
Thank you for quick response!
I use Visual Studio to generate the cmake cache, and building. In other words I create the project as a default CMake solution in VS with default settings. I will include the command line args which visual studio uses. Please excuse the massive text dumb. "Command line: "cmd.exe" /c ""C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe" -G "Ninja" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\chrib\Documents\cli-master\out\install\x64-Debug" -DCMAKE_CXX_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/HostX64/x64/cl.exe" -DCMAKE_C_COMPILER:FILEPATH="C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.23.28105/bin/HostX64/x64/cl.exe" -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "C:\Users\chrib\Documents\cli-master" 2>&1" Making the cache works perfectly. However when I build, I get this output: cmd.exe /C "cd . && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_exe --intdir=examples\CMakeFiles\complete.dir --rc=C:\PROGRA |
It seems like I got it to work by adding some in the CMake-file. By using Boost::thread + Boost::regex instead of Threads I am able to build the examples successfully. find_package(Boost REQUIRED COMPONENTS system thread regex) target_link_libraries(cli INTERFACE Boost::system Boost::thread Boost::regex) |
I managed to reproduce the issue:
Open the directory as a CMake solution, enable The linker complains that I solved changing the following lines in
(i.e. I added boost date_time and regex to the project). However: where those dependencies come from? Anyone can help me with this? |
I fixed the problem. The latest commit should now work. At least, oN my PC it does compile correctly :-) @chrisabr : could you please test the latest commit and tell me if I can close this issue? Thank you very much. |
Fixed in commit fab1d75 |
Hey,
I am trying to build the project in Visual Studio 2019, building it as a CMake project. I get the linker error:
"fatal error LNK1104: cannot open file 'libboost_date_time-vc142-mt-gd-x64-1_70.lib'"
I just dont understand where the dependancy on boosts date_time comes into play. Another curious thing is that it is only building complete.cpp and pluginmanager.cpp that fails. The exe files to filesession.cpp and simplelocalsession.cpp are building correctly without errors. Hope you could shed some light on this issue.
If any other information is needed, please let me know
The text was updated successfully, but these errors were encountered: