Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Cross-compile OpenCV

Hi!

I am trying to cross-compile opencv on a Gumstix board. I followed the tutorial at: http://docs.opencv.org/doc/tutorials/introduction/crosscompilation/arm_crosscompile_with_cmake.html.

First thing to improve the guide: it is my understanding that it must be used static linking for the cross-compiling to work properly. I solved this using: -DBUILD_SHARED_LIBS=OFF. If I am correct would be helpful to mention it.

However, this is not the only problem. The compilation finishes without errors but when I try to compile a simple example I get a lot of undefined reference (I post here just a few lines):

root@overo:~# g++ opencvtest.cpp -L$(pkg-config --libs opencv) /usr/lib/libopencv_highgui.a(grfmt_sunras.cpp.o): In function cv::SunRasterDecoder::readData(cv::Mat&)': grfmt_sunras.cpp:(.text._ZN2cv16SunRasterDecoder8readDataERNS_3MatE+0x158): undefined reference to__gnu_thumb1_case_shi' /usr/lib/libopencv_highgui.a(grfmt_bmp.cpp.o): In function cv::BmpDecoder::readData(cv::Mat&)': grfmt_bmp.cpp:(.text._ZN2cv10BmpDecoder8readDataERNS_3MatE+0x19a): undefined reference to__gnu_thumb1_case_shi' /usr/lib/libopencv_highgui.a(utils.cpp.o): In function cvConvertImage': utils.cpp:(.text.cvConvertImage+0x146): undefined reference to__gnu_thumb1_case_shi' /usr/share/OpenCV/3rdparty/lib/libIlmImf.a(IexThrowErrnoExc.cpp.o): In function `Iex::throwErrnoExc(std::basic_string<char, std::char_traits<char="">, std::allocator<char> > const&, int)': .. ..

Do you know why I get these errors?

Cross-compile OpenCV

Hi!

I am trying to cross-compile opencv on a Gumstix board. I followed the tutorial at: http://docs.opencv.org/doc/tutorials/introduction/crosscompilation/arm_crosscompile_with_cmake.html. docs.opencv.org/doc/tutorials/introduction/crosscompilation/arm_crosscompile_with_cmake.html.

First thing to improve the guide: it is my understanding that it must be used static linking for the cross-compiling to work properly. I solved this using: -DBUILD_SHARED_LIBS=OFF. If I am correct would be helpful to mention it.

However, this is not the only problem. The compilation finishes without errors but when I try to compile a simple example I get a lot of undefined reference (I post here just a few lines):

root@overo:~# g++ opencvtest.cpp -L$(pkg-config --libs opencv) /usr/lib/libopencv_highgui.a(grfmt_sunras.cpp.o): In function cv::SunRasterDecoder::readData(cv::Mat&)': grfmt_sunras.cpp:(.text._ZN2cv16SunRasterDecoder8readDataERNS_3MatE+0x158): undefined reference to__gnu_thumb1_case_shi' /usr/lib/libopencv_highgui.a(grfmt_bmp.cpp.o): In function cv::BmpDecoder::readData(cv::Mat&)': grfmt_bmp.cpp:(.text._ZN2cv10BmpDecoder8readDataERNS_3MatE+0x19a): undefined reference to__gnu_thumb1_case_shi' /usr/lib/libopencv_highgui.a(utils.cpp.o): In function cvConvertImage': utils.cpp:(.text.cvConvertImage+0x146): undefined reference to__gnu_thumb1_case_shi' /usr/share/OpenCV/3rdparty/lib/libIlmImf.a(IexThrowErrnoExc.cpp.o): In function `Iex::throwErrnoExc(std::basic_string<char, std::char_traits<char="">, std::allocator<char> > const&, int)': .. ..

Do you know why I get these errors?

Cross-compile OpenCV

Hi!

I am trying to cross-compile opencv on a Gumstix board. I followed the tutorial at: docs.opencv.org/doc/tutorials/introduction/crosscompilation/arm_crosscompile_with_cmake.html.

First thing to improve the guide: it is my understanding that it must be used static linking for the cross-compiling to work properly. I solved this using: -DBUILD_SHARED_LIBS=OFF. If I am correct would be helpful to mention it.

However, this is not the only problem. The compilation finishes without errors but when I try to compile a simple example I get a lot of undefined reference (I post here just a few lines):

root@overo:~# g++ opencvtest.cpp -L$(pkg-config --libs opencv)
/usr/lib/libopencv_highgui.a(grfmt_sunras.cpp.o): In function cv::SunRasterDecoder::readData(cv::Mat&)':
`cv::SunRasterDecoder::readData(cv::Mat&)':
grfmt_sunras.cpp:(.text._ZN2cv16SunRasterDecoder8readDataERNS_3MatE+0x158): undefined reference to__gnu_thumb1_case_shi'
to `__gnu_thumb1_case_shi'
/usr/lib/libopencv_highgui.a(grfmt_bmp.cpp.o): In function cv::BmpDecoder::readData(cv::Mat&)':
`cv::BmpDecoder::readData(cv::Mat&)':
grfmt_bmp.cpp:(.text._ZN2cv10BmpDecoder8readDataERNS_3MatE+0x19a): undefined reference to__gnu_thumb1_case_shi'
to `__gnu_thumb1_case_shi'
/usr/lib/libopencv_highgui.a(utils.cpp.o): In function cvConvertImage':
`cvConvertImage':
utils.cpp:(.text.cvConvertImage+0x146): undefined reference to__gnu_thumb1_case_shi'
to `__gnu_thumb1_case_shi'
/usr/share/OpenCV/3rdparty/lib/libIlmImf.a(IexThrowErrnoExc.cpp.o): In function `Iex::throwErrnoExc(std::basic_string<char, std::char_traits<char="">, std::char_traits<char>, std::allocator<char> > const&, int)':
..
..

..

Do you know why I get these errors?