我一直在尝试在我的ubunto机器上为arm编译openCV。 当我编译到 arm 时,我收到以下链接错误: uiEscoreDrv.o: In functionmain':
uiEscoreDrv.cpp:(.text+0x2a8): undefined reference to
cv::namedWindow(std::string const&, int)' uiEscoreDrv.cpp:(.text+0x33c): 未定义引用cv::_InputArray::_InputArray(cv::Mat const&)'
uiEscoreDrv.cpp:(.text+0x34c): undefined reference to
cv::_OutputArray::_OutputArray(cv::Mat&)' uiEscoreDrv.cpp:(.text+0x390): undefined reference tocv::_InputArray::_InputArray(cv::Mat const&)'
uiEscoreDrv.cpp:(.text+0x3a0): undefined reference to
cv::imshow(std::string const&, cv::_InputArray const&)' uiEscoreDrv.cpp:(.text+0x4de): 对cv::destroyWindow(std::string const&)'
uiEscoreDrv.o: In function
displayCoreOutput(escore_output&)'的未定义引用: uiEscoreDrv.cpp:(.text+0x1304): 对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::p utText(cv::Mat&, std::string const&, cv::P oint_, int, double, cv::Scalar_, int, int, bool)' uiEscoreDrv.cpp:(.text+0x13ac): 未定义引用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::p utText(cv::Mat&, std::string const&, cv::P oint_, int, double, cv::Scalar_, int, int, bool)' uiEscoreDrv.cpp:(.text+0x1482): undefined reference tocv::_InputArray::_InputArray(cv::Mat const&)'
uiEscoreDrv.cpp:(.text+0x1492): undefined reference to
cv::imshow(std::string const&, cv::InputArray const&)' uiEscoreDrv.o: In functiondisplayAnalytics(escore_output&)':
uiEscoreDrv.cpp:(.text+0x1b44): undefined reference to
cv::rectangle(cv::Mat&, cv::P oint, cv::P oint_, cv::Scalar_ const&, int, int, int)' uiEscoreDrv.cpp:(.text+0x1be0): 未定义引用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::P oint_, cv::P oint_, cv::Scalar_ const&, int, int, int)' uiEscoreDrv.cpp:(.text+0x1e58): 未定义引用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): 未定义引用 'cv::imshow(std::string const&, cv::_InputArray const&)' collect2:错误:ld 返回 1 个退出状态
当我编译到常规 Linux 时,我不明白这个问题。
我已经完成了以下所有步骤: http://docs.opencv.org/2.4/doc/tutorials/introduction/crosscompilation/arm_crosscompile_with_cmake.html
我已将以下内容添加到我的制作文件中: LDFLAGS += -L./-L/usr/local/lib -lutilspkg-config --cflags --libs --static opencv
编译后,我完成了以下步骤: cd/usr/local/lib sudo cp -rf/home/user/eyeSight_projects/opencv-3.2.0/platforms/linux/build_hardfp/install/lib/* .
但是我仍然收到此错误...
任何想法可能出错?
谢谢 奥 伦
这是一个编译问题:-) 我没有将 -I 添加到编译行中:
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