找不到-llept的库

时间:2016-12-01 17:20:17

标签: c++ macos opencv cmake tesseract

使用tesseract和opencv编译程序c ++时出现以下错误:

make
[ 50%] Linking CXX executable car_license_plates
ld: library not found for -llept
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [car_license_plates] Error 1
make[1]: *** [CMakeFiles/car_license_plates.dir/all] Error 2
make: *** [all] Error 2

我的系统是:MacOS X Darwin - 15.4.0 - x86_64

CMakeLists.txt如下:

cmake_minimum_required(VERSION 2.8)
set(CMAKE_BUILD_TYPE Release)
project( car_license_plates )
set(CMAKE_CXX_FLAGS "-Wall -O2 -std=c++0x ")
add_executable( ${PROJECT_NAME} car_license_plates.cpp )
# find opencv package
find_package( OpenCV REQUIRED )
# includes
set(LEPTONICA_INCLUDE_PATH "/usr/local/Cellar/leptonica/1.73/include/leptonica")
set(TESSERACT_INCLUDE_PATH "/usr/local/Cellar/tesseract/3.04.01_2/include/tesseract")
include_directories(${OpenCV_INCLUDE_DIRS} ${LEPTONICA_INCLUDE_PATH} ${TESSERACT_INCLUDE_PATH})
# libraries
set(LEPTONICA_LIBS "lept")
set(TESSERAC_LIBS "tesseract")
set(LIBS ${LIBS} ${OpenCV_LIBS} ${LEPTONICA_LIBS} ${TESSERAC_LIBS})
target_link_libraries(${PROJECT_NAME} ${LIBS})

错误在哪里?

0 个答案:

没有答案