Exporting action client as class library to QtCreator
I've written an action client as a class, which contains several member functions that I hope to use as an API for a backend to a GUI. In this design, the GUI would instantiate the action client class and use its member functions to send goals to an independently running action server.
The GUI is written in QT, so I built my action client class as a static library and I've linked it with catkin_LIBRARIES. After adding my class library as an external library in QT, I get a linker error: /usr/include/boost/system/error_code.hpp|214|undefined reference to boost::system::generic_category()'
Upon seeing this I went back to my CMakeLists.txt for my package and tried to include Boost::system.
I added to CMakeLists.txt:
find_package(Boost REQUIRED COMPONENTS system filesystem thread)
include_directories( include
${catkin_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
add_library(gui_translator_client STATIC
src/gui_translator_client.cpp
)
target_link_libraries(gui_translator_client
${catkin_LIBRARIES}
${Boost_LIBRARIES}
)
This still did not correct the linker error when including the library in Qt, so I decided to explicitly link my class library with Boost_SYSTEM_LIBRARY and BOOST_FILESYSTEM_LIBRARIES.
target_link_libraries(gui_translator_client
${catkin_LIBRARIES}
${Boost_LIBRARIES}
${Boost_SYSTEM_LIBRARY}}
${Boost_FILESYSTEM_LIBRARIES}
)
This prevented my class library from building. Specifically, the line $(Boost_SYSTEM_LIBRARY} produces a build error:
No rule to make target `/usr/lib/x86_64-linux-gnu/libboost_system.so}'
My package.xml has build_depend and run_depend tags for boost and boost_system. libboost_dev-all is installed to my machine.
Are these two build errors the same? Does anyone know how to resolve either?