Спасибо всем, кто придет посмотреть на мой вопрос!
Я получил ошибку:
undefined reference to `cv::imread
undefined reference to `cv::imwrite
undefined reference to cv::String::String
undefined reference to cv::String::~String()
undefined reference to cv::String::operator
Я пробовал каждый ответ, который искал в интернете, кто-нибудь знает, как его решить?
это некоторая информация об opencv, которую я устанавливаю:
Состояние библиотеки OpenCV: версия: 4.0.1
библиотеки: opencv_gapi; opencv_dnn; opencv_calib3d; opencv_features2d; opencv_core; opencv_imgcodecs; opencv_photo; opencv_imgproc; opencv_stitching; opencv_ct_ *; opencv_vc; openc; openc; openc; openc; openg; openc; openc; openg; openc; openc; openg; openc; openc; openg; openg; openc; openc; openg; openc; openc; openg; openg; openc; openc; openc; openg; openc; openc; openg; openg; openc; openc; openg; openg; openg; openg; openc; openc; openg; openg; openc; openc; openg; openg; openg; openg; openg; openg
include-путь: / usr / local / include / opencv4
my CMakeLists.txt
# CMake configuration file
cmake_minimum_required(VERSION 3.4.1)
project(age_gender_proj LANGUAGES CXX)
find_package (OpenCV 4 REQUIRED)
link_directories( ./opencv/lib)
macro(add_df_exec name)
add_executable(${name} test_age_gender_lib.cpp)
set_property(TARGET ${name} PROPERTY
CXX_STANDARD 11)
target_include_directories(${name}
PUBLIC ../include
PUBLIC ${opencv_INCLUDE_DIRS}
)
message(STATUS "OpenCV library status:")
message(STATUS " version: ${OpenCV_VERSION}")
message(STATUS " libraries: ${OpenCV_LIBS}")
message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")
message("source file: " ${Opencv_LIBS})
target_link_libraries(${name} ${OpenCV_LIBS})
TARGET_LINK_LIBRARIES(${name} ${CMAKE_CURRENT_SOURCE_DIR}/../so_files/libgender_lib.so)
TARGET_LINK_LIBRARIES(${name}
${CMAKE_CURRENT_SOURCE_DIR}/../so_files/libfd_lib.so)
TARGET_LINK_LIBRARIES(${name} ${CMAKE_CURRENT_SOURCE_DIR}/../so_files/libage_lib.so)
TARGET_LINK_LIBRARIES(${name} opencv_core)
TARGET_LINK_LIBRARIES(${name} opencv_imgproc)
TARGET_LINK_LIBRARIES(${name} opencv_highgui)
TARGET_LINK_LIBRARIES(${name} opencv_imgcodecs)
endmacro()
add_df_exec(demo)
Я пробовал это, а не работать :(
find_package (OpenCV 4 ТРЕБУЕМЫЕ ПУТИ / usr / local / include / opencv4)