未定义引用符号'boost :: future_category()'

时间:2014-02-17 19:19:24

标签: linux cassandra

我已经在我的ubuntu 12.04 LTS上安装了boost以及Cassandra cpp driver所需的其他依赖项。当我尝试在下面运行命令时,最终会出现两个错误。我找了解决方案,但找不到任何解决方案。有人说通过添加我尝试的选项-lboost_system链接libboost_system,但没有用。

这是cmd:cmake。 &安培;&安培;制造&& make cql_demo&& make cql_test&&进行测试&& make install -lboost_system

我想做的就是从驱动程序运行演示并与cassandra数据库进行通信!

错误:

-- info CMAKE_BINARY_DIR: /home/pi/experiments/cpp-driver-master2
-- Configuring done
-- Generating done
-- Build files have been written to: /home/pi/experiments/cpp-driver-master2
[ 42%] Built target cql
[ 85%] Built target cql_static
[ 87%] Built target CCMBridge
Linking CXX executable cql_integration_tests
/usr/bin/ld: warning: libboost_thread.so.1.55.0, needed by /usr/local/lib/libboost_log.so, may conflict with libboost_thread.so.1.46.1
/usr/bin/ld: CMakeFiles/cql_integration_tests.dir/src/test_utils.cpp.o: undefined reference to symbol 'boost::future_category()'
/usr/bin/ld: note: 'boost::future_category()' is defined in DSO /usr/local/lib/libboost_thread.so.1.55.0 so try adding it to the linker command line
/usr/local/lib/libboost_thread.so.1.55.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: *** [test/integration_tests/cql_integration_tests] Error 1
make[1]: *** [test/integration_tests/CMakeFiles/cql_integration_tests.dir/all] Error 2
make: *** [all] Error 2

1 个答案:

答案 0 :(得分:0)

以下错误:

/usr/bin/ld: warning: libboost_thread.so.1.55.0, needed by /usr/local/lib/libboost_log.so, may conflict with libboost_thread.so.1.46.1

基本上是说你安装了两个版本的Boost:

  • 自定义版本/usr/local/lib/,可能是版本1.55.0。
  • 系统目录中的另一个,可能是版本1.46.1。

当它们都链接到您的二进制版本时1.46.1获胜。

您需要查看CMake调用的所有完整命令行,以便准确说明问题所在。

相关问题