Open jackft2 opened 4 years ago
CMakeFiles/yolo-app.dir/build.make:81: recipe for target' failed make[2]: [CMakeFiles/yolo-app.dir/Darknet.cpp.o] Error 1 CMakeFiles/Makefile2:94: recipe for target 'CMakeFiles/yolo-app.dir/all' failed make[1]: [CMakeFiles/yolo-app.dir/all] Error 2 Makefile:102: recipe for target 'all' failed make: *** [all] Error 2 请问怎么解决的
my CmakeList : cmake_minimum_required(VERSION 3.0 FATAL_ERROR) project(yolo-app)
find_package( OpenCV 3.4.9 REQUIRED ) include_directories( ${OpenCV_INCLUDE_DIRS} ) message(${OpenCV_INCLUDE_DIRS})
find_package(Torch REQUIRED)
aux_source_directory(. DIR_SRCS)
add_executable(yolo-app ${DIR_SRCS}) target_link_libraries(yolo-app "${TORCH_LIBRARIES}" "${OpenCV_LIBS}") set_property(TARGET yolo-app PROPERTY CXX_STANDARD 11)
my terminal show that:
ubuntu@ubuntu-System-Product-Name:~/Desktop/coco/libtorch-yolov3-master/build$ cmake -DCMAKE_PREFIX_PATH='/home/ubuntu/Desktop/libtorch' -- Caffe2: CUDA detected: 10.2 -- Caffe2: CUDA nvcc is: /usr/local/cuda-10.2/bin/nvcc -- Caffe2: CUDA toolkit directory: /usr/local/cuda-10.2 -- Caffe2: Header version is: 10.2 -- Found cuDNN: v7.6.4 (include: /usr/local/cuda-10.2/include, library: /usr/local/cuda-10.2/lib64/libcudnn.so) -- Autodetected CUDA architecture(s): 7.5 -- Added CUDA NVCC flags for: -gencode;arch=compute_75,code=sm_75 -- Configuring done -- Generating done -- Build files have been written to: /home/ubuntu/Desktop/coco/libtorch-yolov3-master/build ubuntu@ubuntu-System-Product-Name:~/Desktop/coco/libtorch-yolov3-master/build$ make -j4 Scanning dependencies of target yolo-app [ 66%] Building CXX object CMakeFiles/yolo-app.dir/detect_cuda_compute_capabilities.cpp.o [ 66%] Building CXX object CMakeFiles/yolo-app.dir/detect_cuda_version.cc.o [100%] Linking CXX executable yolo-app CMakeFiles/yolo-app.dir/detect_cuda_version.cc.o: In function
main': detect_cuda_version.cc:(.text+0x0): multiple definition of
main' CMakeFiles/yolo-app.dir/detect_cuda_compute_capabilities.cpp.o:detect_cuda_compute_capabilities.cpp:(.text+0x0): first defined here collect2: error: ld returned 1 exit status CMakeFiles/yolo-app.dir/build.make:183: recipe for target 'yolo-app' failed make[2]: [yolo-app] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/yolo-app.dir/all' failed make[1]: [CMakeFiles/yolo-app.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2