-1

I'm kind of puzzled as I cannot use imshow from the opencv library. I use plenty of other function from opencv, but I get this error, when I want to show my matrix/image.

Undefined symbols for architecture x86_64:
  "cv::namedWindow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
      _main in main.o
  "cv::imshow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cv::_InputArray const&)", 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)

The the codelines/functions throwing this error are:

cvStartWindowThread();
namedWindow("DisplayImage", WINDOW_AUTOSIZE);
imshow("Display Image", img_bgr);

where img_bgr is my desired matrix.

I'm working on OSX 10.8.5 with Xcode 5.1.1 and opencv-2.4.10 was installed via this walkthrough.

Anyone has an idea and can help why I can't call those above functions? I searched for threads concerning this problem, but none seemed to be satisfying.

EDIT:

Have uninstalled and installed OpenCV twice now. Once with Cmake itself (as application) and once with help of this tutorial. Nothing worked out still get the same error. Does no one have an idea?

SemtexB
  • 660
  • 6
  • 21
  • Are you passing proper flags to linker (path, name of the `opencv` library? – baf May 06 '15 at 13:09
  • I just followed this [walkthrough](http://blogs.wcode.org/2014/11/howto-setup-xcode-6-1-to-work-with-opencv-libraries/). Unsuccessful... – SemtexB May 06 '15 at 13:30

1 Answers1

0

After several trials/hours of troubleshooting I finally got it running. It was sort of steamroller tactics, but whatever. I just formatted my laptop and installed 10.10 Yosemite on a fresh partition. After some building issues with OpenCV, which are initially explained here and solved here it now runs perfectly.

Community
  • 1
  • 1
SemtexB
  • 660
  • 6
  • 21