ios 6 and xcode 4.5 linker problems

来源:互联网 发布:淘宝大牛韩代mlb正品吗 编辑:程序博客网 时间:2024/04/30 12:08

http://answers.opencv.org/question/2868/ios-6-and-xcode-45-linker-problems/

st*, unsigned long)", referenced from:      cv::BmpDecoder::BmpDecoder() in opencv2(grfmt_bmp.o)      cv::BmpEncoder::BmpEncoder() in opencv2(grfmt_bmp.o)      cv::BmpEncoder::newEncoder() const in opencv2(grfmt_bmp.o)      cv::PxMEncoder::PxMEncoder() in opencv2(grfmt_pxm.o)      cv::PxMEncoder::newEncoder() const in opencv2(grfmt_pxm.o)      cv::SunRasterDecoder::SunRasterDecoder() in opencv2(grfmt_sunras.o)      cv::SunRasterEncoder::SunRasterEncoder() in opencv2(grfmt_sunras.o).......  "std::cout", referenced from:      cv::LDA::lda(cv::_InputArray const&, cv::_InputArray const&) in opencv2(lda.o)ld: symbol(s) not found for architecture armv7clang: error: linker command failed with exit code 1 (use -v to see invocation)Showing first 200 notices only

I have only added the generated opencv2.framework to my project and added:

#ifdef __cplusplus    #import <opencv2/opencv.hpp>#endif

At the beginning of my *-Prefix.pch file

Any idea what could be the problem?

Thank you!

2 Answers

Sort by »oldestnewestmost voted
1

answered Dec 3 '12

John Brewer gravatar imageJohn Brewer
51  2  5 

It looks like your project is not linking against the C++ runtime library. To link against the runtime library:

  • Go to the "Build Phases" tab of the project .
  • Choose the "Link Binary With Libraries" section.
  • Click the "+" button at the bottom of the section.
  • From the list that appears, choose either "libc++.dylib" for OpenCV 2.4.3, or "libstdc++.dylib" for OpenCV 2.4.2 and before.

Rebuild, and everything should work.


原创粉丝点击