我想用Raspberry Pi及其凸轮模块实时扫描二维码。我将使用zbar,opencv和C ++。我已经安装了zbar,opencv和相机测试工作正常。我不知道如何链接到CMakeLists.txt中的zbar库。一般来说,我不知道如何在CMake中链接库。以下文本来自CMakeList.txt。
find_package(raspicam REQUIRED)
find_package(OpenCV)
IF ( OpenCV_FOUND AND raspicam_CV_FOUND)
MESSAGE(STATUS "COMPILING OPENCV TESTS")
add_executable (main main.cpp)
target_link_libraries (main ${raspicam_CV_LIBS}${ZBAR_LIBRARIES}zbar)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} /usr/local/lib/cmake/)
ELSE()
MESSAGE(FATAL_ERROR "OPENCV NOT FOUND IN YOUR SYSTEM")
ENDIF()
我有错误
Linking CXX executable main
/usr/bin/ld: cannot find -lraspicam_cvzbar
collect2: ld returned 1 exit status
make[2]: *** [main] Error 1
make[1]: *** [CMakeFiles/main.dir/all] Error 2
make: *** [all] Error 2
请告诉我如何链接Raspberry PI中的zbar库或如何解决这个问题?