【问题标题】:Cross-Compiling openCV for ARM on ubuntu在 ubuntu 上为 ARM 交叉编译 openCV
【发布时间】:2017-07-05 05:54:34
【问题描述】:

我一直在尝试在我的 ubunto 机器上为 arm 编译 openCV。 当我编译到 arm 时,我收到以下链接错误: uiEscoreDrv.o:在函数main': uiEscoreDrv.cpp:(.text+0x2a8): undefined reference tocv::namedWindow(std::string const&, int)' uiEscoreDrv.cpp:(.text+0x33c): 未定义引用cv::_InputArray::_InputArray(cv::Mat const&)' uiEscoreDrv.cpp:(.text+0x34c): undefined reference tocv::_OutputArray::_OutputArray(cv::Mat&)' uiEscoreDrv.cpp:(.text+0x390): 未定义引用cv::_InputArray::_InputArray(cv::Mat const&)' uiEscoreDrv.cpp:(.text+0x3a0): undefined reference tocv::imshow(std::string const&, cv::_InputArray const&)' uiEscoreDrv.cpp:(.text+0x4de): 未定义引用cv::destroyWindow(std::string const&)' uiEscoreDrv.o: In functiondisplayCoreOutput(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 tocv::putText(cv::Mat&, std::string const&, cv::Point_, int, double, cv::Scalar_, int, int , 布尔)' 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 tocv::putText(cv::Mat&, std::string const&, cv::Point_, int, double, cv::Scalar_, int, int , 布尔)' uiEscoreDrv.cpp:(.text+0x1482): 未定义引用cv::_InputArray::_InputArray(cv::Mat const&)' uiEscoreDrv.cpp:(.text+0x1492): undefined reference tocv::imshow(std::string const&, cv::InputArray const&)' uiEscoreDrv.o:在函数displayAnalytics(escore_output&)': uiEscoreDrv.cpp:(.text+0x1b44): undefined reference tocv::rectangle(cv::Mat&, cv::Point, cv::Point_, 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 tocv::rectangle(cv::Mat&, cv::Point_, cv::Point_, 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 tocv::_InputArray::_InputArray(cv::Mat const&)' uiEscoreDrv.cpp:(.text+0x1e98): undefined reference to `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

我已将以下内容添加到我的 Makefile 中: LDFLAGS += -L./ -L/usr/local/lib -lutils pkg-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/* .

但我仍然收到此错误...

有什么想法可能是错的吗?

谢谢, 奥伦

【问题讨论】:

    标签: c++ linux opencv


    【解决方案1】:

    这是一个编译问题 :-) 我没有将 -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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-10
      • 2015-06-11
      • 2018-01-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多