Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

compile error with undefined reference to experimental_dnn_v3

Hello, I am trying to compile some samples in the aruco module on a raspberry pi 3. They compiled with previous versions. I recently upgraded opencv and opencv_contrib to 3.4.1, and get this error:

/usr/local/lib/libopencv_text.so: undefined reference to `cv::dnn::experimental_dnn_v3::Net::empty() const'
/usr/local/lib/libopencv_tracking.so: undefined reference to `cv::dnn::experimental_dnn_v3::Net::forward(cv::String const&)'
/usr/local/lib/libopencv_text.so: undefined reference to `cv::dnn::experimental_dnn_v3::Net::getLayerId(cv::String const&)'
/usr/local/lib/libopencv_tracking.so: undefined reference to `cv::dnn::experimental_dnn_v3::Net::Net()'
/usr/local/lib/libopencv_tracking.so: undefined reference to `cv::dnn::experimental_dnn_v3::readNetFromCaffe(cv::String const&, cv::String const&)'
/usr/local/lib/libopencv_tracking.so: undefined reference to `cv::dnn::experimental_dnn_v3::blobFromImage(cv::_InputArray const&, double, cv::Size_<int> const&, cv::Scalar_<double> const&, bool, bool)'
/usr/local/lib/libopencv_text.so: undefined reference to `cv::dnn::experimental_dnn_v3::Net::getLayerShapes(std::vector<int, std::allocator<int> > const&, int, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >&) const'
/usr/local/lib/libopencv_tracking.so: undefined reference to `cv::dnn::experimental_dnn_v3::Net::~Net()'
/usr/local/lib/libopencv_tracking.so: undefined reference to `cv::dnn::experimental_dnn_v3::Net::setInput(cv::_InputArray const&, cv::String const&)'
collect2: error: ld returned 1 exit status

This is with the command:

g++ -o detect_markers detect_markers.cpp `pkg-config opencv --cflags --libs`

I am not using dnn or tracking, only aruco. I also tried opencv_contrib 3.4.0 and opencv 3.4.0 but have the same issue. Does anyone know what's causing this?