Open
Description
I had install opencv (works fine) but wen i make the project i got this error:
make
mkdir -p obj
mkdir -p results
gcc -Iinclude/ -Isrc/ -DOPENCV `pkg-config --cflags opencv` -Wall -Wno-unknown-pragmas -Wfatal-errors -fPIC -Ofast -DOPENCV -c ./src/gemm.c -o obj/gemm.o
In file included from /usr/local/include/opencv2/core/types_c.h:59:0,
from /usr/local/include/opencv2/core/core_c.h:48,
from /usr/local/include/opencv2/highgui/highgui_c.h:45,
from include/darknet.h:25,
from ./src/utils.h:5,
from ./src/gemm.c:2:
/usr/local/include/opencv2/core/cvdef.h:485:1: error: unknown type name ‘namespace’
namespace cv {
^
compilation terminated due to -Wfatal-errors.
Makefile:85: set di istruzioni per l'obiettivo "obj/gemm.o" non riuscito
make: *** [obj/gemm.o] Errore 1
in english:
Makefile:85: set of instructions for the "obj / gemm.o" target failed
or
Makefile:85: recipe for target 'obj/gemm.o' failed
I've just OpenCV, no CUDA.
Part of Makefile I edited
GPU=0
CUDNN=0
OPENCV=1
OPENMP=0
DEBUG=0
Any solution?
Activity
spinoza1791 commentedon Feb 28, 2018
Makefile OPENCV=1, Platforms tested: Ubuntu 16.04 (updated), Raspberry Pi Stretch 2017-11-29 (updated), darknet version as of 2p CT, 2/28/2018.
NOTE: Cannot reproduce this with OCV 3.4.0 (works fine). This affects OCV 3.4.1 only. Compiling with OPENCV=0 succeeds (no issue).
gcc -DOPENCV pkg-config --cflags opencv -Wall -Wfatal-errors -Ofast -DOPENCV -c ./src/im2col.c -o obj/im2col.o
In file included from /usr/local/include/opencv2/core/types_c.h:59:0,
from /usr/local/include/opencv2/core/core_c.h:48,
from /usr/local/include/opencv2/highgui/highgui_c.h:45,
from ./src/image.c:14:
/usr/local/include/opencv2/core/cvdef.h:485:1: error: unknown type name ‘namespace’
namespace cv {
^
compilation terminated due to -Wfatal-errors.
Makefile:102: recipe for target 'obj/image.o' failed
make: *** [obj/image.o] Error 1
make: *** Waiting for unfinished jobs....
./src/http_stream.cpp: In member function ‘bool MJPGWriter::write(const cv::Mat&)’:
./src/http_stream.cpp:176:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (n < outlen)
^
ValerioNeriGit commentedon Feb 28, 2018
I'm working on Ubuntu server 16.04 and this version of OpenCV: 3.4.0-dev
Should I try to use opencv 3.4.0?
ValerioNeriGit commentedon Feb 28, 2018
I solved with 3.4.0
AlexeyAB commentedon Feb 28, 2018
This is a bug in OpenCV 3.4.1 C API: opencv/opencv#10963
Yumin-Sun-00 commentedon Mar 8, 2018
I have the same issue... Jesus, I am tired with those different dependencies and compatibility.
jesmitty commentedon Mar 13, 2018
I too have same issue with darknet compiling with openCV 3.4.1. It was not clear if this has been resolved and if so, what the set of set were to fix this.
AlexeyAB commentedon Mar 13, 2018
@jesmitty Use OpenCV 3.4.0. Or manually do Proposed fix: opencv/opencv#10963
jesmitty commentedon Mar 14, 2018
jesmitty commentedon Mar 14, 2018
jesmitty commentedon Mar 14, 2018
jesmitty commentedon Mar 14, 2018
Vincentvn119 commentedon Mar 30, 2018
jesmitty, I encountered the same problem when try to compile Yolo with OpenCV 3.4.1.
I used this bash script to install : https://github.com/milq/milq/blob/master/scripts/bash/install-opencv.sh
What I ended up doing is to install Opencv 3.2.0 and Everything good now. Just change OPENCV_VERSION='3.4.1' to OPENCV_VERSION='3.2.0'
jesmitty commentedon Mar 30, 2018
ant1pink commentedon Apr 11, 2018
/darknet$ make
g++ -DOPENCV
pkg-config --cflags opencv
-DGPU -I/usr/local/cuda-8.0/include/ -DCUDNN -Wall -Wfatal-errors -ffp-contract=fast -mavx -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn-8.0/include obj/http_stream.o obj/gemm.o obj/utils.o obj/cuda.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/darknet.o obj/detection_layer.o obj/captcha.o obj/route_layer.o obj/writing.o obj/box.o obj/nightmare.o obj/normalization_layer.o obj/avgpool_layer.o obj/coco.o obj/dice.o obj/yolo.o obj/detector.o obj/layer.o obj/compare.o obj/classifier.o obj/local_layer.o obj/swag.o obj/shortcut_layer.o obj/activation_layer.o obj/rnn_layer.o obj/gru_layer.o obj/rnn.o obj/rnn_vid.o obj/crnn_layer.o obj/demo.o obj/tag.o obj/cifar.o obj/go.o obj/batchnorm_layer.o obj/art.o obj/region_layer.o obj/reorg_layer.o obj/reorg_old_layer.o obj/super.o obj/voxel.o obj/tree.o obj/yolo_layer.o obj/upsample_layer.o obj/convolutional_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/network_kernels.o obj/avgpool_layer_kernels.o -o darknet -lm -pthreadpkg-config --libs opencv
-L/usr/local/cuda-8.0/lib64 -lcuda -lcudart -lcublas -lcurand -L/usr/local/cudnn-8.0/lib64 -lcudnn -lstdc++/usr/bin/ld: cannot find -lippicv
collect2: error: ld returned 1 exit status
Makefile:110: recipe for target 'darknet' failed
make: *** [darknet] Error 1
I got this error when I tied make with "OpenCV=1"
13 remaining items