c++ - OpenCV: Error for failure to load library libopencv_calib3d.2.4.dylib -
I am trying to set up OpenCV (installed with homebrew) on my Mac and run the command.
G ++ $ (PKG-Config - CFLAG - LBS OpenCV) test.cpp -o Test & amp; However, I found this error: [1] 7834 characters: library not loaded: lib / libopencv_calib3d.2.4.dylib Referenced: /usr/local/Cellar/opencv/2.4.9/include/./test Reason: Image Not Found Trace / BPT Trap: 5
I'm not sure what to do Very novice CC and C ++ to open the care of this problem.
The following file structure shows the Test.cpp file is second to the right with the picture. I do not know that the program has not got the file, as the name and location are correct.
test.cpp:
#include "opencv2 / highgui / highgui.hpp" # include & lt; Iostream & gt; Using namespace cv; using namespace std; Int main (matrix argc, const char ** argv) {cout & lt; & Lt; "Test Output Line" & lt; & Lt; Endl; Mat IMG = Remat ("M.P.J.G.", CV_load_IMINUINUINUINT); // Read the image data in the file "MyPic.JPG" and store it in 'IMG' if (img.empty ()) // Check that the image is full or not {cout & lt; & Lt; "Error: Image can not be loaded. !!" & Lt; & Lt; Endl; // system ("pause"); // wait for a major press return -1; } Named Wando ("Myvindo", CV_Windo_AutosIs); // Create a window with the name "Mivindo" imshow ("MyWindow", IMG); // Display the image that is placed in "IGG" window in the "Mivindo" window waiting (0); // Wait an eternal time to destroy a converse ("mywondo"); // Delete the window with the name, "Myndo" return 0; }
Understand it /usr/local/cellar/opencv/2.4. 9 / lib
Dylib files were copied and pasted into / usr / lib
.
Comments
Post a Comment