scutlrr / Yolov4-QtGUI

win10 vs2017 qt_demo yolov4
The Unlicense
136 stars 59 forks source link

no matching function for call to 'Detector::detect(cv::Mat&)'GCC #4

Open xyzhai-pro opened 2 years ago

xyzhai-pro commented 2 years ago

the content of cmakefile is below: project(helloworld)

cmake_minimum_required(VERSION 3.1.0)

find_package(OpenCV REQUIRED) include_directories(${OpenCV_INCLUDE_DIRS})

set(include_darket "./3rdparty/libdarknet/include") include_directories(${include_darket}) include_directories(./QtGuiDemo)

set(lib_darket "./3rdparty/libdarknet/lib/")

link_directories(${lib_darket})

link_libraries("C:\Users\zxy\Desktop\test\Yolov4-QtGUI\3rdparty\libdarknet\lib\yolo_cpp_dll.lib")

link_libraries("C:\Users\zxy\Desktop\test\Yolov4-QtGUI\3rdparty\libdarknet\lib\yolo_cpp_dll_cpu.lib") link_libraries("C:\Users\zxy\Desktop\test\Yolov4-QtGUI\3rdparty\libdarknet\bin\pthreadGC2.lib") link_libraries("C:\Users\zxy\Desktop\test\Yolov4-QtGUI\3rdparty\libdarknet\bin\pthreadVC2.lib")

set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_AUTOUIC ON)

if(CMAKE_VERSION VERSION_LESS "3.7.0") set(CMAKE_INCLUDE_CURRENT_DIR ON) endif()

find_package(Qt5 COMPONENTS Widgets REQUIRED)

add_executable(helloworld QtGuiDemo/QtGuiDemo.ui QtGuiDemo/QtGuiDemo.cpp QtGuiDemo/main.cpp QtGuiDemo/QtGuiDemo.qrc ) link_directories(${OpenCV_LIBRARY_DIRS}) target_link_libraries(helloworld Qt5::Widgets ${OpenCV_LIBS})

xyzhai-pro commented 2 years ago

Look forward to your reply.

xyzhai-pro commented 2 years ago

after:add #define OPENCV the question is below: CMakeFiles\helloworld.dir/objects.a(QtGuiDemo.cpp.obj): In function ZN9QtGuiDemoD2Ev': [build] C:/Users/zxy/Desktop/test/Yolov4-QtGUI/QtGuiDemo/QtGuiDemo.cpp:31: undefined reference toDetector::~Detector()' [build] CMakeFiles\helloworld.dir/objects.a(QtGuiDemo.cpp.obj): In function ZN9QtGuiDemo13init_detectorEv': [build] C:/Users/zxy/Desktop/test/Yolov4-QtGUI/QtGuiDemo/QtGuiDemo.cpp:38: undefined reference toDetector::Detector(std::cxx11::basic_string<char, std::char_traits, std::allocator >, std::cxx11::basic_string<char, std::char_traits, std::allocator >, int)' [build] CMakeFiles\helloworld.dir/objects.a(QtGuiDemo.cpp.obj): In function ZN8Detector14detect_resizedE7image_tiifb': [build] C:/Users/zxy/Desktop/test/Yolov4-QtGUI/3rdparty/libdarknet/include/yolo_v2_class.hpp:103: undefined reference toDetector::detect(image_t, float, bool)' [build] CMakeFiles\helloworld.dir/objects.a(QtGuiDemo.cpp.obj): In function ZNK8Detector19mat_to_image_resizeEN2cv3MatE': [build] C:/Users/zxy/Desktop/test/Yolov4-QtGUI/3rdparty/libdarknet/include/yolo_v2_class.hpp:122: undefined reference toDetector::get_net_height() const' [build] C:/Users/zxy/Desktop/test/Yolov4-QtGUI/3rdparty/libdarknet/include/yolo_v2_class.hpp:122: undefined reference to Detector::get_net_width() const' [build] CMakeFiles\helloworld.dir/objects.a(QtGuiDemo.cpp.obj): In functionZZN8Detector12mat_to_imageEN2cv3MatEENKUlP7image_tEclES3': [build] C:/Users/zxy/Desktop/test/Yolov4-QtGUI/3rdparty/libdarknet/include/yolo_v2_class.hpp:139: undefined reference to `Detector::free_image(image_t)' [build] collect2.exe: error: ld returned 1 exit status