Reputation: 324
I'm trying to use boost 1.46.0 with firebreath. I have read the firebreath wiki on building with external boost but haven't been able to figure it out.
I downloaded boost to ~/boost_1_46_0 and compiled it with bjam. I call prepmake.sh like so:
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 succeeds. I then call make in the firebreath build directory but run into linking errors toward the end.
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
Thanks -Darren
Upvotes: 2
Views: 368
Reputation: 164287
I had a similiar issue where (using external boost 1.56 on windows with VS2013) the linking failed saying it can't find the libraries for boost date_time and regex.
Adding them using
add_boost_library(date_time)
add_boost_library(regex)
had no effect, however this fixed the problem for me:
link_boost_library(${PLUGIN_NAME} date_time)
link_boost_library(${PLUGIN_NAME} regex)
For future references in case anyone stumbles upon this issue.
Upvotes: 0
Reputation: 324
I had to set the boost libraries firebreath uses in my project's PluginConfig.cmake:
add_boost_library(date_time)
add_boost_library(regex)
add_boost_library(system)
add_boost_library(thread)
Weird thing is it seems like firebreath finds them automatically (see below) but unless I manually specify add_boost_library the linker isn't aware of them:
-- 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
Upvotes: 1