Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cannnot statically compile opencv code

Hello, I have statically cross compiled opencv-2.4.13 for ARM , the installation directory is /Desktop/opencv-build. now I am trying to compile a simple opencv code that displays an image using this command:

/arm-buildroot-linux-uclibcgnueabi-g++ opencv.cpp -L/Desktop/opencv-build/lib/libopencv_highgui.a -L/Desktop/opencv-build/lib/libopencv_imgproc.a -L/Desktop/opencv-build/lib/libopencv_core.a -o ocvccode

I then get this error message

opencv.cpp:(.text+0x7c): undefined reference to cv::imread(std::string const&, int)' opencv.cpp:(.text+0xc8): undefined reference tocv::namedWindow(std::string const&, int)' opencv.cpp:(.text+0x118): undefined reference to cv::_InputArray::_InputArray(cv::Mat const&)' opencv.cpp:(.text+0x12c): undefined reference tocv::imshow(std::string const&, cv::_InputArray const&)' opencv.cpp:(.text+0x14c): undefined reference to cv::waitKey(int)' /tmp/ccksKPb6.o: In functioncv::Mat::~Mat()': opencv.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x3c): undefined reference to cv::fastFree(void*)' /tmp/ccksKPb6.o: In functioncv::Mat::release()': opencv.cpp:(.text._ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x58): undefined reference to `cv::Mat::deallocate()' collect2: error: ld returned 1 exit status

how to solve this and is there is any other way to statically compile opencv code for ARM?