简体   繁体   中英

i am getting this error while making a build for opencv project on mac os (intel chip)

i am running any code(over xcodes)even "hello world" and i am getting the same error all the time how can i fix this?????

dyld: Library not loaded: /usr/local/opt/opencv/lib/libopencv_stitching.4.5.dylib
  Referenced from: /Users/khaledzbidat/Library/Developer/Xcode/DerivedData/OpencvCourse_-hhaivjyxxrgltdhgizcoxxkwobzu/Build/Products/Debug/OpencvCourse_
  Reason: no suitable image found.  Did find:
    /usr/local/opt/opencv/lib/libopencv_stitching.4.5.dylib: code signature in (/usr/local/opt/opencv/lib/libopencv_stitching.4.5.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
    /usr/local/lib/libopencv_stitching.4.5.dylib: code signature in (/usr/local/lib/libopencv_stitching.4.5.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
    /usr/local/Cellar/opencv/4.5.4_4/lib/libopencv_stitching.4.5.4.dylib: code signature in (/usr/local/Cellar/opencv/4.5.4_4/lib/libopencv_stitching.4.5.4.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
(lldb) 

It looks like you need to disable library validation for your app to load this library. Apple are getting stricter and stricter about what will and will not run on macOS.

You can do this in the 'Signing and Capabilities' tab of your project settings for your app build target (my app is called VinylStudio, in this example):

在此处输入图像描述

Then, hopefully, your library will load and the app will run.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM