当前位置:   article > 正文

Mac(m1) clion编译opencv报错building for macOS-x86_64 but attempting to link with file built for macOS-ar

building for macos-x86_64 but attempting to link with file built for macos-a

代码如下:

 

 

具体报错如下:

ignoring file /opt/homebrew/opt/opencv@3/lib/libopencv_dnn.3.4.16.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64

ld: warning: ignoring file /opt/homebrew/opt/opencv@3/lib/libopencv_video.3.4.16.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64

ld: warning: ignoring file /opt/homebrew/opt/opencv@3/lib/libopencv_datasets.3.4.16.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64

ld: warning: ignoring file /opt/homebrew/opt/opencv@3/lib/libopencv_videoio.3.4.16.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64

ld: warning: ignoring file /opt/homebrew/opt/opencv@3/lib/libopencv_objdetect.3.4.16.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64

ld: warning: ignoring file /opt/homebrew/opt/opencv@3/lib/libopencv_imgcodecs.3.4.16.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64

ld: warning: ignoring file /opt/homebrew/opt/opencv@3/lib/libopencv_imgproc.3.4.16.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64

ld: warning: ignoring file /opt/homebrew/opt/opencv@3/lib/libopencv_flann.3.4.16.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64

ld: warning: ignoring file /opt/homebrew/opt/opencv@3/lib/libopencv_calib3d.3.4.16.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64

ld: warning: ignoring file /opt/homebrew/opt/opencv@3/lib/libopencv_photo.3.4.16.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64ld: warning: ignoring file /opt/homebrew/opt/opencv@3/lib/libopencv_features2d.3.4.16.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64

解决办法:

在cmake中添加编译选项:

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/351503?site
推荐阅读
相关标签
  

闽ICP备14008679号