赞
踩
代码如下:
具体报错如下:
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中添加编译选项:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。