Ask Your Question

Undefined symbols for architecture x86_64:

asked 2013-03-16 10:37:11 -0500

nomo gravatar image


I'm trying to build a opencv program (c++), using sublime2 (an editor). But I got "Undefined symbols for architecture x86_64:" error.

I googled it, and it seems sublime2 refers wrong opencv libaries. Where can I change the setting? and what is the basic problem of this error?


edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2013-03-17 14:23:47 -0500

Basic problem is simple, you are using x32 bit (x86) prebuilt libraries for OpenCV, on a x64 bit system. So make sure that youre project settings are set for the correct target system.

How you should do that in sublime2, you should ask on a specific forum for that software...

edit flag offensive delete link more

answered 2013-06-04 01:45:41 -0500

openedcv gravatar image


i'm having the same Undefined symbols for architecture x86_64 problem. like this:

Undefined symbols for architecture x86_64:
  "cv::fastMalloc(unsigned long)", referenced from:
      cv::Ptr<_IplImage>::Ptr(_IplImage*) in main.o
  "cv::Mat::deallocate()", referenced from:
      cv::Mat::release() in main.o
  "cv::Mat::Mat(_IplImage const*, bool)", referenced from:
      _main in main.o
  "cv::Ptr<_IplImage>::delete_obj()", referenced from:
      cv::Ptr<_IplImage>::release() in main.o
  "cv::fastFree(void*)", referenced from:
      cv::Ptr<_IplImage>::release() in main.o
      cv::Mat::~Mat() in main.o
  "_cvLoadImage", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

this i get when trying to compile an example opencv2 code from the 2.4.5 page. just installed it via cmake on os x 10.8.3. was trying xcode by setting up the build settings: using stdlib and correct include and lib paths. linker is complaining about - apparently according to the answer here above - a 32 bit system. but it's wrong:

$ file libopencv_photo.2.4.5.dylib
libopencv_photo.2.4.5.dylib: Mach-O 64-bit dynamically linked shared library x86_64

i'm really getting tired of trying to compile a simple opencv example on os x with xcode. or without xcode. i built and rebuilt everything a few times. had 2.4.2 and now 2.4.5 and always the same crap: Undefined symbols for architecture x86_64

i'd appreciate some help with this. thanks....

edit flag offensive delete link more



First of all, creating a new question within an existing question is not allowed on the Q&A forum. It makes it completely unclear and difficult to manage. Read the FAQ to know how to use this forum properly.

Secondly, try to go through the basic guide for osx first, before compiling examples at once. There must be something wrong in either your linker/general project settings or in your system variable.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-06-04 02:10:03 -0500 )edit

Question Tools


Asked: 2013-03-16 10:37:11 -0500

Seen: 8,845 times

Last updated: Jun 04 '13