configure error about dnn

asked 2018-01-26 05:51:26 -0600

bkzero gravatar image

updated 2018-01-26 05:53:04 -0600

berak gravatar image

build without opencv_contribe, make and make install successfully. build my own example successfully. but when i add:

#include <opencv2/dnn.hpp>

compile error:

In file included from /opt/local/include/opencv2/dnn/dnn.hpp:57:0,
from /opt/local/include/opencv2/dnn.hpp:62,
from /home/zero/Code/dlib/dlib-2/examples/face.cpp:23:
/opt/local/include/opencv2/dnn/dict.hpp:63:21: error: expected ‘)’ before ‘i’
DictValue(int64 i = 0) : type(Param::INT), pi(new AutoBuffer<int64,1>) { (*pi)[0] = i; } //!< Constructs integer scalar
^
In file included from /opt/local/include/opencv2/dnn/dnn.hpp:57:0,
from /opt/local/include/opencv2/dnn.hpp:62,
from /home/zero/Code/dlib/dlib-2/examples/face.cpp:23:
/opt/local/include/opencv2/dnn/dict.hpp:102:28: error: template argument 1 is invalid
AutoBuffer<int64, 1> *pi;
^
/opt/local/include/opencv2/dnn/dict.hpp:102:28: error: template argument 2 is invalid
/opt/local/include/opencv2/dnn/dict.hpp: In constructor ‘cv::dnn::experimental_dnn_v3::DictValue::DictValue(int)’:
/opt/local/include/opencv2/dnn/dict.hpp:64:86: error: template argument 1 is invalid
CV_WRAP DictValue(int i) : type(Param::INT), pi(new AutoBuffer<int64,1>) { (*pi)[0] = i; } //!< Constructs integer scalar
^
/opt/local/include/opencv2/dnn/dict.hpp:64:86: error: template argument 2 is invalid
/opt/local/include/opencv2/dnn/dict.hpp:64:98: error: invalid types ‘int[int]’ for array subscript
CV_WRAP DictValue(int i) : type(Param::INT), pi(new AutoBuffer<int64,1>) { (*pi)[0] = i; } //!< Constructs integer scalar
^
/opt/local/include/opencv2/dnn/dict.hpp: In constructor ‘cv::dnn::experimental_dnn_v3::DictValue::DictValue(unsigned int)’:
/opt/local/include/opencv2/dnn/dict.hpp:65:78: error: template argument 1 is invalid
DictValue(unsigned p) : type(Param::INT), pi(new AutoBuffer<int64,1>) { (*pi)[0] = p; } //!< Constructs integer scalar
^
/opt/local/include/opencv2/dnn/dict.hpp:65:78: error: template argument 2 is invalid
/opt/local/include/opencv2/dnn/dict.hpp:65:90: error: invalid types ‘int[int]’ for array subscript
DictValue(unsigned p) : type(Param::INT), pi(new AutoBuffer<int64,1>) { (*pi)[0] = p; } //!< Constructs integer scalar
^
In file included from /opt/local/include/opencv2/dnn.hpp:62:0,
from /home/zero/Code/dlib/dlib-2/examples/face.cpp:23:
/opt/local/include/opencv2/dnn/dnn.hpp: At global scope:
/opt/local/include/opencv2/dnn/dnn.hpp:305:17: error: reference to ‘int64’ is ambiguous
virtual int64 getFLOPS(const std::vector &inputs,
^
In file included from /opt/local/include/opencv2/core/cvdef.h:91:0,
from /opt/local/include/opencv2/core.hpp:52,
from /opt/local/include/opencv2/core/core.hpp:48,
from /home/zero/Code/dlib/dlib-2/dlib/../dlib/opencv/cv_image.h:6,
from /home/zero/Code/dlib/dlib-2/dlib/../dlib/opencv.h:10,
from /home/zero/Code/dlib/dlib-2/examples/face.cpp:6:
/opt/local/include/opencv2/core/hal/interface.h:61:20: note: candidates are: typedef int64_t int64
typedef int64_t int64;
^
In file included from /home/zero/Code/dlib/dlib-2/dlib/../dlib/image_processing/../image_processing/../geometry/../algs.h:87:0,
from /home ...
(more)
edit retag flag offensive close merge delete

Comments

  • which compiler is it ? (it does not know int64_t and such)
  • i cannot find your code here: https://github.com/davisking/dlib/tre...
  • you don't need dlib at all, to run opencv's dnn samples. simplify the problem, and try without dlib first
  • "build without opencv_contrib" -- it does not matter at all.
berak gravatar imageberak ( 2018-01-26 06:00:16 -0600 )edit