there occurs an error: when I run command make: undefined reference to `cv::String::deallocate()', what should i do

…/bin/dchobj/fcn_inference.o: In function readDataFromImg(cv::Mat, unsigned char*)': /home/nvidia/TensorRT-3.0.0/samples/tensorRT_fcn/fcn_inference.cpp:108: undefined reference to cv::resize(cv::_InputArray const&, cv::OutputArray const&, cv::Size, double, double, int)’
…/…/bin/dchobj/fcn_inference.o: In function showOutputImage(long, nvinfer1::DataType, void*, cv::Mat)': /home/nvidia/TensorRT-3.0.0/samples/tensorRT_fcn/fcn_inference.cpp:233: undefined reference to cv::addWeighted(cv::_InputArray const&, double, cv::_InputArray const&, double, double, cv::_OutputArray const&, int)’
/home/nvidia/TensorRT-3.0.0/samples/tensorRT_fcn/fcn_inference.cpp:234: undefined reference to cv::namedWindow(cv::String const&, int)' /home/nvidia/TensorRT-3.0.0/samples/tensorRT_fcn/fcn_inference.cpp:235: undefined reference to cv::imshow(cv::String const&, cv::_InputArray const&)’
/home/nvidia/TensorRT-3.0.0/samples/tensorRT_fcn/fcn_inference.cpp:236: undefined reference to cv::waitKey(int)' ../../bin/dchobj/fcn_inference.o: In function execute(nvinfer1::ICudaEngine&)‘:
/home/nvidia/TensorRT-3.0.0/samples/tensorRT_fcn/fcn_inference.cpp:322: undefined reference to cv::imread(cv::String const&, int)' ../../bin/dchobj/fcn_inference.o: In function cv::String::String(char const*)’:
/usr/include/opencv2/core/cvstd.hpp:601: undefined reference to cv::String::allocate(unsigned long)' ../../bin/dchobj/fcn_inference.o: In function cv::String::~String()‘:
/usr/include/opencv2/core/cvstd.hpp:647: undefined reference to cv::String::deallocate()' ../../bin/dchobj/fcn_inference.o: In function cv::String::operator=(cv::String const&)’:
/usr/include/opencv2/core/cvstd.hpp:655: undefined reference to cv::String::deallocate()' ../../bin/dchobj/fcn_inference.o: In function cv::Mat::Mat(cv::Mat const&)‘:
/usr/include/opencv2/core/mat.inl.hpp:490: undefined reference to cv::Mat::copySize(cv::Mat const&)' ../../bin/dchobj/fcn_inference.o: In function cv::Mat::~Mat()’:
/usr/include/opencv2/core/mat.inl.hpp:692: undefined reference to cv::fastFree(void*)' ../../bin/dchobj/fcn_inference.o: In function cv::Mat::create(int, int, int)‘:
/usr/include/opencv2/core/mat.inl.hpp:784: undefined reference to cv::Mat::create(int, int const*, int)' ../../bin/dchobj/fcn_inference.o: In function cv::Mat::release()’:
/usr/include/opencv2/core/mat.inl.hpp:804: undefined reference to cv::Mat::deallocate()' ../../bin/dchobj/fcn_inference.o: In function cv::Mat::operator=(cv::Mat&&)‘:
/usr/include/opencv2/core/mat.inl.hpp:1336: undefined reference to cv::fastFree(void*)' ../../bin/dchobj/fcn_inference.o: In function cv::String::String(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)’:
/usr/include/opencv2/core/cvstd.inl.hpp:83: undefined reference to `cv::String::allocate(unsigned long)’
collect2: error: ld returned 1 exit status
…/Makefile.config:167: recipe for target ‘…/…/bin/sample_fcn_debug’ failed
make: *** […/…/bin/sample_fcn_debug] Error 1

Hi,

If you have used OpenCV libraries, please remember to link the libraries in Makefile.

Thanks.

I have added the opencv library path, it did not work.

Hi,

It looks like there is a missing definition.
Please remember to include OpenCV header in the Makefile.

Thanks.