首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >架构x86_64的未定义符号:"boost::this_thread::interruption_point()“

架构x86_64的未定义符号:"boost::this_thread::interruption_point()“
EN

Stack Overflow用户
提问于 2022-08-20 20:55:17
回答 1查看 38关注 0票数 0

我正在用make构建一些东西,我得到了以下错误。我不知道该怎么做,而且我在java之外的经验也有限。

我尝试了boost版本1.80.0、1.39.0和1.46.1,但它们都有相同的错误。

有人能帮忙吗?

代码语言:javascript
复制
Undefined symbols for architecture x86_64:
  "boost::this_thread::interruption_point()", referenced from:
      boost::condition_variable::wait(boost::unique_lock<boost::mutex>&) in sip_client.cpp.o
      boost::condition_variable::do_wait_until(boost::unique_lock<boost::mutex>&, boost::detail::real_platform_timepoint const&) in sip_client.cpp.o
  "boost::detail::get_current_thread_data()", referenced from:
      boost::detail::interruption_checker::interruption_checker(_opaque_pthread_mutex_t*, _opaque_pthread_cond_t*) in sip_client.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [bin/sip_client] Error 1
make[1]: *** [examples/sip_client/CMakeFiles/sip_client.dir/all] Error 2
make: *** [all] Error 2
EN

回答 1

Stack Overflow用户

发布于 2022-08-21 03:29:37

添加编译器选项-lboost_thread。

更新:

websocketpp附带了CMakeFiles,作为您要构建的示例。我不能让那些提供的制造文件来建造,而且我对cmake知之甚少,无法修复它。但是,通过在Linux上运行这个示例,我可以在没有cmake的情况下构建这个示例:

代码语言:javascript
复制
cd websocketpp/examples/sip_client

clang++ sip_client.cpp -lpthread -lboost_thread -Wall -g
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73430102

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档