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_64ui

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

 
 
 
 
 find_package(Boost COMPONENTS filesystem system  REQUIRED)
 
 
 
 
 

而后报了新的错误:it

 

dyld: Library not loaded: libboost_filesystem.dylibio

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

Reason: image not foundfile

程序异常结束。 程序

 

没有找到库,咱们在cmake里面把静态库打开便可:im

 
 
 
 
 set(Boost_USE_STATIC_LIBS ON)
 
 
 
 
 
相关文章
相关标签/搜索