0

what's wrong with my code?

#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>

using namespace std;
using namespace cv;

int main(int argc, const char * argv[]) {
    // insert code here...
    Mat  image;
    image = imread("/Users/2mythvector/Downloads/IMG_2897.JPG");
    namedWindow("Image", WINDOW_AUTOSIZE);
    imshow("Image", image);
    cout << "OK!"<< endl;;
    waitKey(0);
    return 0;
}

and this is the error

dyld: Library not loaded: /opt/homebrew/opt/opencv/lib/libopencv_gapi.4.5.dylib
Referenced from: /Users/2mythvector/Library/Developer/Xcode/DerivedData/CvPro-grqqwbrbjnryjxbeyuwissvxdbpc/Build/Products/Debug/CvPro 
Reason: no suitable image found.  
Did find:
/opt/homebrew/opt/opencv/lib/libopencv_gapi.4.5.dylib: code signature in (/opt/homebrew/opt/opencv/lib/libopencv_gapi.4.5.dylib) not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
/opt/homebrew/Cellar/opencv/4.5.3/lib/libopencv_gapi.4.5.3.dylib: code signature in (/opt/homebrew/Cellar/opencv/4.5.3/lib/libopencv_gapi.4.5.3.dylib) not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)
Program ended with exit code: 9
kiner_shah
  • 3,445
  • 6
  • 25
  • 36

0 Answers0