1

我使用 Xcode 构建了一个 boost 示例,但正如您所见,它失败了。我得到的错误是:

Undefined symbols for architecture x86_64:
  "boost::system::system_category()", referenced from:
      ___cxx_global_var_init2 in sync_client.o
      boost::asio::error::get_system_category() in sync_client.o
      boost::system::error_code::error_code() in sync_client.o
  "boost::system::generic_category()", referenced from:
      ___cxx_global_var_init in sync_client.o
      ___cxx_global_var_init1 in sync_client.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我不知道我该如何解决。我已将 boost 的 include 和 libs 路径添加到 Xcode Build Setting 中。有人对这个问题有任何想法吗?

4

1 回答 1

2

链接到 libboost-system.so 的预构建版本或将 libs/system/src/error_code.cpp(来自您的 boost 源包)拉入您的项目。

于 2013-08-12T22:34:06.487 回答