cmake: error: symbol(s) not found for architecture x86_64 mac os 使用boost asio

最近在使用boost的asio库,在mac osx 上编写网络服务程序报错:

:-1: error: symbol(s) not found for architecture x86_64

然后在CMakeList.txt的boost 加filesystem systen依赖:

find_package(Boost COMPONENTS filesystem system  REQUIRED)

然后报了新的错误:

dyld: Library not loaded: libboost_filesystem.dylib

Referenced from: /Users/xxx/Desktop/project/build-xxxxx-unknown-Default/xxxxx

Reason: image not found

程序异常结束。

没有找到库,我们在cmake里面把静态库打开即可:

set(Boost_USE_STATIC_LIBS ON)
上一篇:symbol(s) not found for architecture x86_64 之 linker command failed with exit code 1 (use -v to see invocation)解决方案排查


下一篇:HTTPS协议学习总结