使用仅标头库时提高了链接错误 [英] Boost linker errors when using header only libraries

查看:189
本文介绍了使用仅标头库时提高了链接错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用升压1.53.0的下列组件连同C ++ 11库。 。 。

I am using the following components of boost 1.53.0 in conjunction with C++11 libs . . .


  • 的boost :: signals2 :: scoped_connection

  • 的boost :: signals2 ::信号

  • 的boost :: signals2 ::连接

  • 的boost ::数学::常量

  • 的boost :: circular_buffer

  • 的boost :: lexical_cast的

根据这个答案,我不需要反对库链接使用boost的这些部分。据<一个href=\"http://stackoverflow.com/questions/6690721/does-the-boost-signals2-library-need-to-be-built\">this回答,signals2应该只还头。不过,我仍然收到链接错误。 。 。

According to this answer, I do not need to link against libraries to use these parts of boost. According to this answer, signals2 should be header only also. However, I still receive linker errors . . .

Undefined symbols for architecture i386:
  "boost::system::system_category()", referenced from:
  ___cxx_global_var_init2 in Main.o
  ...
  "boost::system::generic_category()", referenced from:
  ___cxx_global_var_init in Main.o
  ___cxx_global_var_init1 in Main.o
  ...

为什么?

推荐答案

的问题是虚假的。

#include <boost/thread/mutex.hpp>

意外地留在文件中的中间。

accidentally left in the middle of a file.

这篇关于使用仅标头库时提高了链接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆