linking boost components - catkin error
I followed most of the answers on how to link properly a library and still I cant compile my package with catkin_make, due to undefined reference to boost::log::v2s_mt_posix::trivial::logger::get()
Here is my the summary of my CMakeList.txt:
cmake_minimum_required(VERSION 2.8.3)
project(pleora_polarcam)
add_definitions(-std=c++11)
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_FLAGS "-lboost_system")
set(CMAKE_CXX_FLAGS "-lpthread")
find_package(catkin REQUIRED COMPONENTS
roscpp
cv_bridge
image_transport
dynamic_reconfigure
driver_base
camera_info_manager
)
find_package(OpenCV REQUIRED)
find_package(Boost 1.54 COMPONENTS log_setup log program_options thread REQUIRED)
catkin_package(
INCLUDE_DIRS include
LIBRARIES photonfocus_camera
CATKIN_DEPENDS cv_bridge image_transport roscpp
DEPENDS system_lib
DEPENDS Boost opencv
)
include_directories(
${Boost_INCLUDE_DIR}
${catkin_INCLUDE_DIRS}
${EBUS_INCLUDE_DIRS}
${GNUTLS_INCLUDE_DIR}
)
add_executable(pix2image src/pix2image.cpp)
target_link_libraries(pix2image
${OpenCV_LIBRARIES}
-lpthread
${Boost_LIBRARIES}
${catkin_LIBRARIES}
)