Ask Your Question

Revision history [back]

OpenCV compile error with Xcode 5

Same old error:

Undefined symbols for architecture x86_64:
  "cv::applyColorMap(cv::_InputArray const&, cv::_OutputArray const&, int)", referenced from:
      _main in test.o
  "cv::subspaceProject(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&)", referenced from:
      _main in test.o
  "cv::subspaceReconstruct(cv::_InputArray const&, cv::_InputArray const&, cv::_InputArray const&)", referenced from:
      _main in test.o
  "cv::createEigenFaceRecognizer(int, double)", referenced from:
      _main in test.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The code I was trying is:

https://gist.github.com/hihell/0520674421fe0cb26d38

I already changed C++ standard library to "Compiler Default" but the error is still there.

However, other simple code like showing a picture or open the camera works fine with the same settings.

Versions:

  • The OpenCV was installed by brew, version 2.4.8
  • Xcode version 5.1.1
  • OSX version 10.9.3

Could anyone help me? Any help or hint is more than welcome