Ask Your Question

hihell's profile - activity

2014-06-18 03:33:13 -0600 asked a question 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

2013-03-05 13:10:49 -0600 commented answer OpenCV on Mac OS X 10.8 Mountain Lion

And make sure you are using the right compiler if you are a MAC user, the xCode will using APPLE LLVM, you have to change it to LLVM GCC. Otherwise it will report a lot of errors like this.