完全按照官网步骤,clone之后修改Makefile,增加opencv、cuda、cudnn支持,然后进行make,结果出现:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
/usr/bin/ld: warning: libzstd.so.1.3.7, needed by //home/mcj/anaconda3/lib/libtiff.so.5, not found (try using -rpath or -rpath-link) //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_freeCStream’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_maxCLevel’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_getErrorName’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_createDStream’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_freeDStream’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_compressStream’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_decompressStream’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_initCStream’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_createCStream’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_isError’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_endStream’未定义的引用 //home/mcj/anaconda3/lib/libtiff.so.5:对‘ZSTD_initDStream’未定义的引用 collect2: error: ld returned 1 exit status Makefile:77: recipe for target 'darknet' failed make: *** [darknet] Error 1 |
解决方法:
打开profile文件:
1 |
sudo vim /etc/profile |
在文件末尾添加(注意路径):
1 |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/mcj/anaconda3/lib |
然后激活一下:
1 |
source /etc/profile |
修改后编译效果如下:
1 2 3 4 |
gcc -Iinclude/ -Isrc/ -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -c ./examples/darknet.c -o obj/darknet.o gcc -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -shared obj/gemm.o obj/utils.o obj/cuda.o obj/deconvolutional_layer.o obj/convolutional_layer.o obj/list.o obj/image.o obj/activations.o obj/im2col.o obj/col2im.o obj/blas.o obj/crop_layer.o obj/dropout_layer.o obj/maxpool_layer.o obj/softmax_layer.o obj/data.o obj/matrix.o obj/network.o obj/connected_layer.o obj/cost_layer.o obj/parser.o obj/option_list.o obj/detection_layer.o obj/route_layer.o obj/upsample_layer.o obj/box.o obj/normalization_layer.o obj/avgpool_layer.o obj/layer.o obj/local_layer.o obj/shortcut_layer.o obj/logistic_layer.o obj/activation_layer.o obj/rnn_layer.o obj/gru_layer.o obj/crnn_layer.o obj/demo.o obj/batchnorm_layer.o obj/region_layer.o obj/reorg_layer.o obj/tree.o obj/lstm_layer.o obj/l2norm_layer.o obj/yolo_layer.o obj/iseg_layer.o obj/image_opencv.o obj/convolutional_kernels.o obj/deconvolutional_kernels.o obj/activation_kernels.o obj/im2col_kernels.o obj/col2im_kernels.o obj/blas_kernels.o obj/crop_layer_kernels.o obj/dropout_layer_kernels.o obj/maxpool_layer_kernels.o obj/avgpool_layer_kernels.o -o libdarknet.so -lm -pthread `pkg-config --libs opencv` -lstdc++ -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand -lcudnn -lstdc++ ar rcs libdarknet.a obj/gemm.o obj/utils.o obj/cuda.o obj/deconvolutional_layer.o obj/convolutional_layer.o obj/list.o obj/image.o obj/activations.o obj/im2col.o obj/col2im.o obj/blas.o obj/crop_layer.o obj/dropout_layer.o obj/maxpool_layer.o obj/softmax_layer.o obj/data.o obj/matrix.o obj/network.o obj/connected_layer.o obj/cost_layer.o obj/parser.o obj/option_list.o obj/detection_layer.o obj/route_layer.o obj/upsample_layer.o obj/box.o obj/normalization_layer.o obj/avgpool_layer.o obj/layer.o obj/local_layer.o obj/shortcut_layer.o obj/logistic_layer.o obj/activation_layer.o obj/rnn_layer.o obj/gru_layer.o obj/crnn_layer.o obj/demo.o obj/batchnorm_layer.o obj/region_layer.o obj/reorg_layer.o obj/tree.o obj/lstm_layer.o obj/l2norm_layer.o obj/yolo_layer.o obj/iseg_layer.o obj/image_opencv.o obj/convolutional_kernels.o obj/deconvolutional_kernels.o obj/activation_kernels.o obj/im2col_kernels.o obj/col2im_kernels.o obj/blas_kernels.o obj/crop_layer_kernels.o obj/dropout_layer_kernels.o obj/maxpool_layer_kernels.o obj/avgpool_layer_kernels.o gcc -Iinclude/ -Isrc/ -DOPENCV `pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -Wall -Wno-unused-result -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -DGPU -DCUDNN obj/captcha.o obj/lsd.o obj/super.o obj/art.o obj/tag.o obj/cifar.o obj/go.o obj/rnn.o obj/segmenter.o obj/regressor.o obj/classifier.o obj/coco.o obj/yolo.o obj/detector.o obj/nightmare.o obj/instance-segmenter.o obj/darknet.o libdarknet.a -o darknet -lm -pthread `pkg-config --libs opencv` -lstdc++ -L/usr/local/cuda/lib64 -lcuda -lcudart -lcublas -lcurand -lcudnn -lstdc++ libdarknet.a |
本文最后更新于2021年9月8日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!
真心感谢您的帮助!
看一下
太棒了
看看吧
看一下
还是不行collect2: error: ld returned 1 exit status
Makefile:77: recipe for target ‘darknet’ failed
make: *** [darknet] Error 1
看一下
遇到同样的问题了,想看看楼主怎么解决的,学习一下
good好
来看看效果如何 博主真棒
来看看
想看一下
看答案
想看一下
我看看
看一下
shashasha我看看
希望能够找到问题的解决方法
我也遇到相同的问题,不知道怎么解决
好,测试以下。
评论了还是看不到解决办法
@yi 现在可以了~
遇到同样的问题
好
libdarknet.a(maxpool_layer_kernels.o): In function
__device_stub__Z29backward_maxpool_layer_kerneliiiiiiiPfS_Pi(int, int, int, int, int, int, int, float*, float*, int*)':
__cudaPopCallConfiguration’tmpxft_00004121_00000000-5_maxpool_layer_kernels.compute_52.cudafe1.cpp:(.text+0x39f): undefined reference to
libdarknet.a(maxpool_layer_kernels.o): In function
backward_maxpool_layer_gpu':
__cudaPushCallConfiguration’tmpxft_00004121_00000000-5_maxpool_layer_kernels.compute_52.cudafe1.cpp:(.text+0x496): undefined reference to
collect2: error: ld returned 1 exit status
Makefile:77: recipe for target ‘darknet’ failed
make: *** [darknet] Error 1
到底該如何解決呢
opencv3装了两天了 做毕设急着用 网上搜了很多方法都不行 等楼主的方法,弄好回来打卡
好棒想看
想看答案啊!
为啥看不了啊?
ces to
cv::String::deallocate()' follow
cv::Mat::~Mat()’:libdarknet.a(image_opencv.o): In function
image_opencv.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x89): undefined reference to
cv::Mat::deallocate()'
cv::fastFree(void*)’image_opencv.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x72): undefined reference to
collect2: error: ld returned 1 exit status
Makefile:77: recipe for target ‘darknet’ failed
make: *** [darknet] Error 1
错误啊
您好评论了还是看不了
@喏喏心 你好,现在可以了。
@马春杰杰 你好,/etc/profile文件修改之后, 我的是:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/mou/anaconda2/lib ,依旧出现Makefile:77: recipe for target ‘darknet’ failed
我想重启试试,然后电脑输入密码之后就进入不了linux系统图形界面,
这是什么原因呢?