isicom
isicom

Reputation: 103

opencv Apple Mach-O Linker

I am trying to run an opencv project by xcode6.

This tutorial is cool and works for me, first, without xcode: The application runs perfectly after make'ing.

Now, I want to use Xcode 6 as development environment. But I get an Apple Mach-O Linker error.

Build Settings are:

Header Search Paths : /usr/local/include (non-recursive)
Library Search Paths: /urs/local/lib (non-recursive)

Build Phases > Link Binary With Libraries:

Libc++.dylib

This is the error:

Ld /Users/XXX/Library/Developer/Xcode/DerivedData/HelloWorld-ejnkjggujedpyibjbhvocitoxxaj/Build/Products/Debug/HelloWorld normal x86_64
    cd /Users/XXX/Desktop/make/CLTproject/HelloWorld/HelloWorld
    export MACOSX_DEPLOYMENT_TARGET=10.10
    /Applications/Xcode-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -L/Users/XXX/Library/Developer/Xcode/DerivedData/HelloWorld-ejnkjggujedpyibjbhvocitoxxaj/Build/Products/Debug -L/usr/local/lib -F/Users/XXX/Library/Developer/Xcode/DerivedData/HelloWorld-ejnkjggujedpyibjbhvocitoxxaj/Build/Products/Debug -filelist /Users/XXX/Library/Developer/Xcode/DerivedData/HelloWorld-ejnkjggujedpyibjbhvocitoxxaj/Build/Intermediates/HelloWorld.build/Debug/HelloWorld.build/Objects-normal/x86_64/HelloWorld.LinkFileList -mmacosx-version-min=10.10 -stdlib=libc++ -lc++ -Xlinker -dependency_info -Xlinker /Users/XXX/Library/Developer/Xcode/DerivedData/HelloWorld-ejnkjggujedpyibjbhvocitoxxaj/Build/Intermediates/HelloWorld.build/Debug/HelloWorld.build/Objects-normal/x86_64/HelloWorld_dependency_info.dat -o /Users/XXX/Library/Developer/Xcode/DerivedData/HelloWorld-ejnkjggujedpyibjbhvocitoxxaj/Build/Products/Debug/HelloWorld

Undefined symbols for architecture x86_64:
  "cv::namedWindow(cv::String const&, int)", referenced from:
      _main in main.o
  "cv::GaussianBlur(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)", referenced from:
      _main in main.o
  "cv::Mat::deallocate()", referenced from:
      cv::Mat::release() in main.o
  "cv::Mat::copySize(cv::Mat const&)", referenced from:
      cv::Mat::operator=(cv::Mat const&) in main.o
  "cv::String::deallocate()", referenced from:
      cv::String::~String() in main.o
  "cv::String::allocate(unsigned long)", referenced from:
      cv::String::String(char const*) in main.o
  "cv::imread(cv::String const&, int)", referenced from:
      _main in main.o
  "cv::imshow(cv::String const&, cv::_InputArray const&)", referenced from:
      _main in main.o
  "cv::waitKey(int)", referenced from:
      _main in main.o
  "cv::fastFree(void*)", referenced from:
      cv::Mat::~Mat() in main.o
  "cv::Mat::copyTo(cv::_OutputArray const&) const", referenced from:
      cv::Mat::clone() const in main.o
  "vtable for cv::_InputArray", referenced from:
      cv::_InputArray::_InputArray() in main.o
      cv::_InputArray::_InputArray(cv::Mat const&) in main.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "vtable for cv::_OutputArray", referenced from:
      cv::_OutputArray::_OutputArray(cv::Mat&) in main.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any Idea?

Thanks,

isicom

Upvotes: 2

Views: 2253

Answers (1)

Will
Will

Reputation: 21

Just to give some light to everybody in the same problem. I added all libraries and worked fine for me. I stayed in the libc++ with no building errors.

Upvotes: 1

Related Questions