开发者

Linux make can't link against Boost non-header only libraries

开发者 https://www.devze.com 2023-03-26 12:44 出处:网络
I successfully switched to Linux, and I really start to love it. Except that I can\'t link code against Boost libraries that are non-header only.

I successfully switched to Linux, and I really start to love it. Except that I can't link code against Boost libraries that are non-header only.

Steps that I have taken:

  1. Run sudo apt-get install libboost.*-dev in terminal to install the Boost 开发者_开发技巧libraries
  2. Let CMake generate my make-files and locate the Boost libraries as I have done it on Windows.
  3. Run make to compile.

The same code compiles and link fine under Windows with Microsoft Visual C++.

Further information

  • Console Output
  • Source

What else do I need to do?


From your output and your CMakeFiles it doesn't look like you are linking your code to the Boost filesystem library.

That is,

target_link_libraries(RCMeta ${Boost_FILESYSTEM_LIBRARY} ${Boost_REGEX_LIBRARY})

Note: I may have the variable name wrong for that library you may have to double check it.

You can also use the generic ${Boost_LIBRARIES} variable,

target_link_libraries(RCMeta ${Boost_LIBRARIES})

for your RCMeta library.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号