Opened 10 years ago

Last modified 3 years ago

#41794 closed defect

Gcc48 incompatible with opencv — at Version 1

Reported by: giacomo.dabisias@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.2.1
Keywords: Cc: ryandesign@…, mww@…, stromnov@…
Port: gcc48, opencv

Description (last modified by ryandesign (Ryan Carsten Schmidt))

I installed using macport gcc48 and opencv. I tried to compile a simple opencv example with the compiler and I get:

Undefined symbols for architecture x86_64:
  "cv::namedWindow(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)", referenced from:
      _main in ccot2eJS.o
  "cv::VideoCapture::VideoCapture(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from:
      _main in ccot2eJS.o
  "cv::imshow(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&)", referenced from:
      _main in ccot2eJS.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

If i use the gcc provided by apple or clang the program compiles. I also tried to recompile opencv by myself and i still get the same error. I tested all this also on a second machine having the same results. It seems that there is some incompatibility between gcc48 and opencv.

Change History (1)

comment:1 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… mww@… stromnov@… added
Description: modified (diff)
Port: gcc48 opencv added

On what operating system? If OS X 10.9 Mavericks or later, this is expected because of the mismatch between libstdc++ (used by FSF GCC) and libc++ (used by all other compilers, including Apple's GCC, llvm-gcc and clang). The solution is to use a compiler other than FSF GCC.

Last edited 10 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)
Note: See TracTickets for help on using tickets.