Compiling openCV for ARM on ubuntu

I have been trying to compile openCV for arm on my ubunto machine. When i compile to arm i am getting the below linkage errors: uiEscoreDrv.o: In function main': uiEscoreDrv.cpp:(.text+0x2a8): undefined reference to cv::namedWindow(std::string const&, int)' uiEscoreDrv.cpp:(.text+0x33c): undefined reference to cv::_InputArray::_InputArray(cv::Mat const&)' uiEscoreDrv.cpp:(.text+0x34c): undefined reference to cv::_OutputArray::_OutputArray(cv::Mat&)' uiEscoreDrv.cpp:(.text+0x390): undefined reference to cv::_InputArray::_InputArray(cv::Mat const&)' uiEscoreDrv.cpp:(.text+0x3a0): undefined reference to cv::imshow(std::string const&, cv::_InputArray const&)' uiEscoreDrv.cpp:(.text+0x4de): undefined reference to cv::destroyWindow(std::string const&)' uiEscoreDrv.o: In function displayCoreOutput(escore_output&)': uiEscoreDrv.cpp:(.text+0x1304): undefined reference to cv::putText(cv::Mat&, std::string const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)' uiEscoreDrv.cpp:(.text+0x1358): undefined reference to cv::putText(cv::Mat&, std:: string const&, cv::Point_, int, double, cv::Scalar_, int, int, bool)' uiEscoreDrv.cpp:(.text+0x13ac): undefined reference to cv::putText(cv::Mat&, std::string const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)' uiEscoreDrv.cpp:(.text+0x1452): undefined reference to cv::putText(cv::Mat&, std::string const&, cv::Point_, int, double, cv::Scalar_, int, int, bool)' uiEscoreDrv.cpp:(.text+0x1482): undefined reference to cv::_InputArray::_InputArray(cv::Mat const&)' uiEscoreDrv.cpp:(.text+0x1492): undefined reference to cv::imshow(std::string const&, cv::InputArray const&)' uiEscoreDrv.o: In function displayAnalytics(escore_output&)': uiEscoreDrv.cpp:(.text+0x1b44): undefined reference to cv::rectangle(cv::Mat&, cv::Point, cv::Point_, cv::Scalar_ const&, int, int, int)' uiEscoreDrv.cpp:(.text+0x1be0): undefined reference to cv::putText(cv::Mat&, std::string const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)' uiEscoreDrv.cpp:(.text+0x1cb6): undefined reference to cv::putText(cv::Mat&, std::string const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)' uiEscoreDrv.cpp:(.text+0x1cb6): undefined reference to cv::rectangle(cv::Mat&, cv::Point_, cv::Point_, cv::Scalar_ const&, int, int, int)' uiEscoreDrv.cpp:(.text+0x1e58): undefined reference to cv::rectangle(cv::Mat&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)' uiEscoreDrv.cpp:(.text+0x1e88): undefined reference to cv::_InputArray::_InputArray(cv::Mat const&)' uiEscoreDrv.cpp:(.text+0x1e98): undefined reference to `cv::imshow(std::string const&, cv::_InputArray const&)' collect2: error: ld returned 1 exit status

When i compile to regular linux, i dont get this the problem.

I have done all the steps from: http://docs.opencv.org/2.4/doc/tutorials/introduction/crosscompilation/arm_crosscompile_with_cmake.html

I have added the below to my Makefile: LDFLAGS += -L./ -L/usr/local/lib -lutils pkg-config --cflags --libs --static opencv

After the compilation i have done the below steps: cd /usr/local/lib sudo cp -rf /home/user/eyeSight_projects/opencv-3.2.0/platforms/linux/build_hardfp/install/lib/* .

But i am still getting this error...

Any ideas what can be wrong?

Thanks, Oren


It was a compilation issue :-) I didnt add the -I to the compilation line:

LOCAL_INCLUDE_FLAGS= -I/usr/local/include -I ../../api/ -I ../../ $(CROSS_COMPILE)g++ -std=c++11 -lsdtc++ -fPIC -c -o uiEscoreDrv.o -fPIC $(CFLAGS) $(LOCAL_INCLUDE_FLAGS) uiEscoreDrv.cpp

链接地址: http://www.djcxy.com/p/95156.html

上一篇: OpenCV通过NuGet包与Visual Studio 2015,如何配置?

下一篇: 在Ubuntu上编译ARM的openCV