Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in make step I meet a error with main.cpp #48

Open
jackft2 opened this issue Jul 1, 2020 · 1 comment
Open

in make step I meet a error with main.cpp #48

jackft2 opened this issue Jul 1, 2020 · 1 comment

Comments

@jackft2
Copy link

jackft2 commented Jul 1, 2020

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

@WANGCHAO1996
Copy link

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
请问怎么解决的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants