cmake - 将 libconfig++ 添加到 CMake
问题描述
我正在尝试添加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++,我链接了目录,链接了库,不知道还有什么问题..
解决方案
推荐阅读
- javascript - 使用 SSI 渲染 HTML(服务器端渲染)
- vb.net - VB.Net 在子程序中间进行 DOM 更改
- android - Row() 中的最后一个可组合项被压缩(Jetpack Compose)
- csharpcodeprovider - jsondiffpatch 工具如何解释数组
- f# - 如何添加对象的副本而不是对其的引用
- nginx - nginx反向代理上游过早关闭连接,同时从上游读取响应头
- xslt - XSLT 按同一级别的 2 个标签排序
- android - 如何实现改变 viewHolder 内容的滑动效果
- javascript - 导航时页面未重新加载(“/”)(svelte-routing)
- python - Tkinter - 如何使用模块传递变量?