且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

c++ - 使用clion为什么cmake引入boost不成功

更新时间:2023-09-19 23:20:34

find_package(Boost 1.62.0)应该改成find_package(Boost REQUIRED COMPONENTS system)
再加上target_link_libraries(untitled1 ${Boost_LIBRARIES}) 让cmake去搞定Boost。
另外,再加上链接Ws2_32.lib库。

if(WIN32)
    target_link_libraries(untitled wsock32 ws2_32)
endif()