Добавление libconfig ++ в CMake - PullRequest
       68

Добавление libconfig ++ в CMake

0 голосов
/ 02 октября 2018

Я пытаюсь добавить libconfig++ в свой проект CMake, но он все еще жалуется

Libconfig library is config++
...
CMakeFiles/CustomCamReaderTask.dir/acA2440-20gc_ConfigUtility.cc.o: undefined reference to symbol '_ZN13ConfigSection3getERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERl'
.../lib/libconfig.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Вот мой CMakeLists.txt

find_package(PkgConfig)
pkg_check_modules(LIBCONFIG_PLUSPLUS libconfig++ REQUIRED)

add_executable(CustomCamReaderTask
    CustomCamReaderTask.cc
    acA2440-20gc_ConfigUtility.cc)

target_include_directories(CustomCamReaderTask
    PRIVATE ${CMAKE_SOURCE_DIR}/src/include/Pylon5
    /opt/pylon5/include)

message("Libconfig library is ${LIBCONFIG_PLUSPLUS_LIBRARIES}")

target_link_libraries(CustomCamReaderTask
    ${LIBCONFIG_PLUSPLUS_LIBRARIES}
    ${PYLON_LIBS}
    task
    imageUtility
    ${OPENCV_LIBRARIES})

link_directories(/opt/pylon5/lib64)
link_libraries(${LIBCONFIG_PLUSPLUS_LIBRARIES})

Кажется, что найти config ++, Я связал каталог, связал библиотеку, не уверен, что еще не так ..

...