用外部助力建立firebreath的问题

时间:2013-05-03 17:48:54

标签: firebreath

我正在尝试使用带有firebreath的boost 1.46.0。我已经在建筑物上阅读了firebreath wiki,但没有能够解决这个问题。

我将boost下载到〜/ boost_1_46_0并使用bjam编译。我这样称呼prepmake.sh:

prepmake.sh projectdir builddir -DCMAKE_BUILD_TYPE="Release" \
     -DVERBOSE=1 \
     -DWITH_SYSTEM_BOOST=1 \
     -DBOOST_ROOT="~/boost_1_46_0/" \
     -DBoost_USE_STATIC_LIBS=on \
     -DBoost_USE_STATIC_RUNTIME=off

Prepmake成功。然后我在firebreath构建目录中调用make,但最后会遇到链接错误。

Linking CXX shared library ../../bin/Test/npTest.so
../../ScriptingCore/libScriptingCore.a(URI.cpp.o): In function `global constructors keyed to URI.cpp':
URI.cpp:(.text+0x637): undefined reference to `boost::system::generic_category()'
URI.cpp:(.text+0x643): undefined reference to `boost::system::generic_category()'
URI.cpp:(.text+0x64f): undefined reference to `boost::system::system_category()'
URI.cpp:(.text+0x65b): undefined reference to `boost::system::system_category()'
../../ScriptingCore/libScriptingCore.a(URI.cpp.o): In function `FB::URI::isLocalhost() const':
URI.cpp:(.text+0x3065): undefined reference to `boost::system::system_category()'
URI.cpp:(.text+0x3095): undefined reference to `boost::system::system_category()'
URI.cpp:(.text+0x32ed): undefined reference to `boost::system::system_category()'
../../ScriptingCore/libScriptingCore.a(URI.cpp.o):URI.cpp:(.text+0x3569): more undefined references to `boost::system::system_category()' follow

谢谢-Darren

3 个答案:

答案 0 :(得分:2)

看起来你错过了升级系统库

答案 1 :(得分:1)

我必须在我的项目的PluginConfig.cmake中设置firebreath使用的boost库:

add_boost_library(date_time)
add_boost_library(regex)
add_boost_library(system)
add_boost_library(thread)

奇怪的是,似乎firebreath会自动找到它们(见下文),但除非我手动指定add_boost_library,否则链接器不会知道它们:

-- Boost version: 1.46.0
-- Found the following Boost libraries:
--   thread
--   system
-- Boost version: 1.46.0
-- Found the following Boost libraries:
--   thread
--   system
--   date_time
-- Boost version: 1.46.0
-- Found the following Boost libraries:
--   thread
--   system
--   date_time
--   regex
-- Configuring done
-- Generating done

答案 2 :(得分:0)

我有一个类似的问题(在VS2013的Windows上使用外部升级1.56)链接失败,说它无法找到boost date_time和regex的库。

使用

添加它们
add_boost_library(date_time)
add_boost_library(regex)

没有效果,但这解决了我的问题:

link_boost_library(${PLUGIN_NAME} date_time)
link_boost_library(${PLUGIN_NAME} regex)

如果有人偶然发现此问题,请参考以后的参考资料。