Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker error while installing opencv: Undefined symbols for architecture arm64 #1566

Closed
kafka-tamura opened this issue Sep 18, 2023 · 3 comments

Comments

@kafka-tamura
Copy link

kafka-tamura commented Sep 18, 2023

Undefined symbols for architecture arm64:
  "Imf_3_2::Chromaticities::Chromaticities(Imath_2_5::Vec2<float> const&, Imath_2_5::Vec2<float> const&, Imath_2_5::Vec2<float> const&, Imath_2_5::Vec2<float> const&)", referenced from:
      cv::ExrDecoder::ExrDecoder() in grfmt_exr.cpp.o
  "Imf_3_2::Header::Header(int, int, float, Imath_2_5::Vec2<float> const&, float, Imf_3_2::LineOrder, Imf_3_2::Compression)", referenced from:
      cv::ExrEncoder::write(cv::Mat const&, std::__1::vector<int, std::__1::allocator<int>> const&) in grfmt_exr.cpp.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libopencv_imgcodecs.4.8.0.dylib] Error 1
make[1]: *** [modules/imgcodecs/CMakeFiles/opencv_imgcodecs.dir/all] Error 2
make: *** [all] Error 2

I get the above error when trying to install opencv on M1 iMac.

@cary-ilm
Copy link
Member

This sounds similar to #1538, possibly discrepencies in how different compilers handle symbol export directives. Can you describe more about what compiler version you're using?

@cary-ilm
Copy link
Member

Oh, no, I see you're building OpenEXR 3.2 against Imath 2.5, which should not be entirely impossible but may well cause problems. Can you describe more about exactly how you're building opencv?

@kafka-tamura
Copy link
Author

I was able to resolve this. I realised that some Imath 2.5 needed to be upgraded. The data for my M1 Mac was imported from 2013 MacBook pro, so many of the libraries were outdated. I updated the libraries 1 by 1 and was eventually able to install this. Don't remember the exact sequence of events I followed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants