2013-02-14 64 views
1

我得到這個錯誤,我嘗試向基於OpenCV庫添加到MonoTouch的項目:鏈接的OpenCV與MonoTouch的返回「爲i386硬件架構未定義的符號」錯誤

Undefined symbols for architecture i386: 
     "cv::isContourConvex(cv::_InputArray const&)", referenced from: 
    aruco::MarkerDetector::detectRectangles(cv::Mat const&, std::vector<aruco::MarkerDetector::MarkerCandidate, std::allocator<aruco::MarkerDetector::MarkerCandidate> >&)in libAruco.a(markerdetector.o) 
     "cv::warpPerspective(cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, cv::Size_<int>, int, int, cv::Scalar_<double> const&)", referenced from: 
    aruco::MarkerDetector::warp_cylinder(cv::Mat&, cv::Mat&, cv::Size_<int>, aruco::MarkerDetector::MarkerCandidate&)in libAruco.a(markerdetector.o) 
    aruco::MarkerDetector::warp(cv::Mat&, cv::Mat&, cv::Size_<int>, std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >)in libAruco.a(markerdetector.o) 
     "cv::FileNodeIterator::readRaw(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char*, unsigned long)", referenced from: 
    cv::VecReaderProxy<float, 1>::operator()(std::vector<float, std::allocator<float> >&, unsigned long) constin libAruco.a(board.o) 
     "cv::FileNodeIterator::FileNodeIterator(CvFileStorage const*, CvFileNode const*, unsigned long)", referenced from: 
    cv::FileNode::begin() constin libAruco.a(board.o) 
    cv::FileNode::end() constin libAruco.a(board.o) 

這只是完整的樣本列表opencv方法是有這個問題,因爲它很容易超過100.

我試圖在模擬器中運行此(我只有試用版monotouch)。我正在編譯xcode中的ipad模擬器,並且遵循Opencv教程,儘可能使用他們網站上的預建框架來設置我的項目。我可能想知道是否需要輸入一些鏈接器標誌,因爲我的靜態庫並不像我期望的那樣大,因爲它需要鏈接幾個opencv模塊(這只是一種直覺而已)必然指示任何事情)。

我想它也很重要,要提到我在iOS和MonoTouch開發方面的經驗很少,所以我可能錯失了一些非常簡單的東西。

回答

2

您的靜態庫可能不是FAT(多種體系結構)庫,也可能不包括代碼i386

最簡單的方法,找出是嘗試,從終端窗口:

lipo -info libAruco.a 

這應該返回類似:

Architectures in the fat file: libAruco.a are: i386 ... 

其中...可能armv7(或更多),以支持iOS設備。

OTOH如果i386丟失,那麼這意味着您的庫沒有編譯爲在模擬器上工作。在這種情況下,您需要返回到Xcode來構建此體系結構,並使用lipo創建FAT庫(其中包括armi386體系結構)。

+0

嘿, 感謝您的答覆,當我做了脂-info libaruco我得到了以下結果: 輸入文件libAruco.a不是fat文件 非FAT文件:libAruco.a是架構:I386 然後我創建了一個FAT庫,但是我擔心我會遇到和以前一樣的錯誤 – 2013-02-14 20:33:46

相關問題