Closed igo312 closed 1 year ago
I build the facedetection by the instruction of
build by MinGw
, and the cmake that to build detect-image.exe is following:I build the project by two instructions:
cmake -G "MinGW Makefiles" cmake --build .
can anyone tell me what should I do?
cmake_minimum_required(VERSION 3.05) project(detect-image) set(TARGET "det_image") set(CMAKE_C_COMPILIER "gcc") set(CMAKE_C_COMPILIER "g++") find_package(OpenCV REQUIRED) find_package(facedetection REQUIRED) if(facedetection_FOUND) message("find facedetection") endif() include_directories("D:\\code\\c++\\libfacedetection\\build\\install\\include\\facedetection") add_executable(${TARGET} detect-image.cpp) target_link_libraries(${TARGET} ${OpenCV_LIBS}) target_link_libraries(${TARGET} ${facedetection_LIBS})
Hello, it might be due to the lack of header files. Please confirm if you have correctly imported facedetection.h and facedetection_export.h.
@Wwupup thanks for your response! I know the mistake in my cmake file.
target_link_libraries(${TARGET} ${facedetection_LIBS})
should be
target_link_libraries(${TARGET} facedetection)
it is weird that ${facedetection_LIBS}
is empty
I build the facedetection by the instruction of
build by MinGw
, and the cmake that to build detect-image.exe is following:I build the project by two instructions:
can anyone tell me what should I do?