link error: opencv 2.4.2 libc++ (Bug #2412)


Added by Alex Fridlyand over 4 years ago. Updated almost 2 years ago.


Status:Open Start date:2012-10-04
Priority:Low Due date:
Assignee:- % Done:

0%

Category:build/install
Target version:-
Affected version:2.4.0 - 2.4.5 Operating System:Mac OSX
Difficulty: HW Platform:x64
Pull request:

Description

Xcode 4.5; cannot link opencv 2.4.2 with my project:

highgui.dylib:

Undefined symbols for architecture x86_64:
"cv::imread(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)"

without libc++ everything works (if disable all C++11 features in my project), but I really need them.


Related issues

duplicated by Bug #2319: OpenCV/iOS linkage with libc++ fails Cancelled 2012-08-28

History

Updated by Alex Fridlyand over 4 years ago

this solved my problem.

So, users that want C++11 support can't install openCV with brew.

Updated by Alex Fridlyand over 4 years ago

Alex Fridlyand wrote:

this solved my problem.
http://spointeau.blogspot.com/2012/07/opencv-and-clang-c-2011-on-mac-os-x.html
So, users that want C++11 support can't install openCV with brew.

Updated by Vadim Pisarevsky over 4 years ago

  • Target version deleted ()
  • Category changed from highgui-images to build/install
  • Assignee deleted (Vadim Pisarevsky)

Updated by Christian Richardt over 4 years ago

I had the same problem and just finished writing up my experience: http://richardt.name/blog/opencv-with-cxx11-on-os-x-10-8/.

In essence, it’s better to patch Google Test for libc++ (https://codereview.appspot.com/6332052/) than using the approach mentioned above.

Updated by Kirill Kornyakov over 4 years ago

  • Target version set to Next Hackathon

Updated by Vadim Pisarevsky over 4 years ago

  • Target version changed from Next Hackathon to 2.4.4
  • Assignee set to Vadim Pisarevsky

Updated by Andrey Kamaev over 4 years ago

Vadim, could you check if the problem still exists in 2.4 branch? The issue might be fixed by b0d3830

Updated by Vadim Pisarevsky over 4 years ago

  • Affected version set to 2.4.2
  • Target version deleted (2.4.4)

Updated by Vadim Pisarevsky over 4 years ago

  • Assignee deleted (Vadim Pisarevsky)

Updated by Marco Bertini over 4 years ago

The problem persists if you use Unix Makefiles instead of XCode: adding -std=c++11 -stdlib=libc++ to the CMAKE_CXX_FLAGS and CMAKE_EXE_LINKER_FLAGS then become annoying for CUDA compilation, because the nvcc frontend receives a -dumpspecs that is not supported by clang. On the other hand if changing the CUDA compiler to gcc it does not support the C++11 flags that are passed to it.

Updated by Vadim Pisarevsky over 4 years ago

ok, since the problem does not appear when Xcode is used to build OpenCV (and with xcodebuild it can even be done from command-line or a script), I lower priority of the bug

  • Priority changed from High to Low

Updated by Kirill Kornyakov over 4 years ago

  • Target version set to 2.4.5

Updated by Andrey Kamaev about 4 years ago

  • Target version changed from 2.4.5 to 2.4.6

Updated by Kirill Kornyakov almost 4 years ago

Could anybody confirm that the issue still exists?

  • HW Platform set to x64
  • Operating System set to Mac OSX
  • Affected version changed from 2.4.2 to 2.4.0 - 2.4.5
  • Target version deleted (2.4.6)

Updated by Maksim Shabunin almost 2 years ago

Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4433

Also available in: Atom PDF