Open ferhatm opened 6 years ago
Do you have CUDA installed? Unfortunately, I haven't built CPU support yet. What OpenCV version do you have? Make sure its updated to version 3.
If you do have CUDA installed and OpenCV3, try adding set(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
to your CMakeLists.txt. This might be related to an issue with your OpenCV version similar to this.
yoloObjectDetector::~yoloObjectDetector()': /home/nvidia/ip_ws/src/darknet_ros/src/yolo_ros.cpp:89: undefined reference to
cv::destroyWindow(cv::String const&)'
CMakeFiles/yolo_ros.dir/src/yolo_ros.cpp.o: In function yoloObjectDetector::runYOLO(cv::Mat&)': /home/nvidia/ip_ws/src/darknet_ros/src/yolo_ros.cpp:178: undefined reference to
cv::imshow(cv::String const&, cv::_InputArray const&)'
CMakeFiles/yolo_ros.dir/src/yolo_ros.cpp.o: In function yoloObjectDetector::yoloObjectDetector()': /home/nvidia/ip_ws/src/darknet_ros/src/yolo_ros.cpp:84: undefined reference to
cv::namedWindow(cv::String const&, int)'
collect2: error: ld returned 1 exit status
darknet_ros/CMakeFiles/yolo_ros.dir/build.make:4557: recipe for target '/home/nvidia/ip_ws/devel/lib/darknet_ros/yolo_ros' failed
make[2]: [/home/nvidia/ip_ws/devel/lib/darknet_ros/yolo_ros] Error 1
CMakeFiles/Makefile2:1141: recipe for target 'darknet_ros/CMakeFiles/yolo_ros.dir/all' failed
make[1]: [darknet_ros/CMakeFiles/yolo_ros.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2set(CUDA_USE_STATIC_CUDA_RUNTIME OFF) set( CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS}; -O3 -gencode arch=compute_20,code=[sm_20,sm_21] -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] -gencode arch=compute_53,code=sm_53 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_62,code=sm_62
)
-- after typing : sudo ln -s /usr/local/cuda/lib64/libcudart.so /usr/lib/libopencv_dep_cudart.so
Any idea again? Thanks
HEY! While I''m trying to compile your code with catkim_make, I'm taking this error :
Scanning dependencies of target single_image_test [ 9%] Linking CXX executable /home/nvidia/ip_ws/devel/lib/darknet_ros/yolo_ros [ 9%] Building CXX object darknet_ros/CMakeFiles/single_image_test.dir/src/single_image_test.cpp.o /usr/bin/ld: cannot find -lopencv_dep_cudart collect2: error: ld returned 1 exit status darknet_ros/CMakeFiles/yolo_ros.dir/build.make:4557: recipe for target '/home/nvidia/ip_ws/devel/lib/darknet_ros/yolo_ros' failed make[2]: [/home/nvidia/ip_ws/devel/lib/darknet_ros/yolo_ros] Error 1 CMakeFiles/Makefile2:1141: recipe for target 'darknet_ros/CMakeFiles/yolo_ros.dir/all' failed make[1]: [darknet_ros/CMakeFiles/yolo_ros.dir/all] Error 2 make[1]: Waiting for unfinished jobs.... /home/nvidia/ip_ws/src/darknet_ros/src/single_image_test.cpp:26:13: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] char cfg = "/home/catkin_ws/src/darknet_ros/cfg/tiny-yolo-voc.cfg"; ^ /home/nvidia/ip_ws/src/darknet_ros/src/single_image_test.cpp:27:17: warning: deprecated conversion from string constant to ‘char’ [-Wwrite-strings] char weights = "/home/catkin_ws/src/darknet_ros/weights/tiny-yolo-voc.weights"; ^ [ 9%] Linking CXX executable /home/nvidia/ip_ws/devel/lib/darknet_ros/single_image_test /usr/bin/ld: cannot find -lopencv_dep_cudart collect2: error: ld returned 1 exit status darknet_ros/CMakeFiles/single_image_test.dir/build.make:2900: recipe for target '/home/nvidia/ip_ws/devel/lib/darknet_ros/single_image_test' failed make[2]: [/home/nvidia/ip_ws/devel/lib/darknet_ros/single_image_test] Error 1 CMakeFiles/Makefile2:1609: recipe for target 'darknet_ros/CMakeFiles/single_image_test.dir/all' failed make[1]: [darknet_ros/CMakeFiles/single_image_test.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: [all] Error 2 Invoking "make -j4 -l4" failed
Any idea? Thanks