Xcode version 6.4,OPENCV version 3.0.0
Yesterday after I installed OpenCV, excited to follow this article on the MAC platform OPENCV development environment to build the steps, in Xcode built a demo project, the results of compilation has been unsuccessful. First, include header file times wrong <cstdint> not found, and then search the Internet, the buildsettings in the C + + Language dialect changed to GNU98. Import header file no problem, but ..... There are new errors, roughly reported "Undefined symbols for x86_64", I changed the C + + standard language to libstdc++, or useless ... Helpless, I again put OpenCV reinstall again ... Until then, I just thought, will I import the OpenCV library when there is no guide? I this time, the/usr/local/lib below all the LIBOPENCV beginning of the files are imported into the project, run successfully ~~~~~
This lesson, the decision or the process of the project to stick out, after the problem came back to turn over.
1, a new command line tool project.
2, language select C + +.
3, direct point create.
4, in the project to create a new group, named OpenCV Lib (you can also name other names, casual)
5, left check OpenCV Lib, right-click popup menu, select Add Files to Demo1 ..., then pop up a window to select the file.
6, type "/" (or use the shortcut key command+shift+g), pop up to the window, enter the OPENCV library path.
7. Select all files with LIBOPENCV file name, uncheck copy items if needed, and click Add.
8. Select the project, modify the paths in build settings, change the header search User paths to "/usr/lcoal/include" and change the library search paths to "/usr/local/ Lib ".
9, edit the content of Main.cpp
////main.cpp//Demo1////Created by cw-it-mini-011 on 15/7/16.//Copyright (c) 2015 Tinayang. All rights reserved.//#include<opencv2/opencv.hpp>using namespaceCV;intMainintargcConst Char*argv[]) { //Insert code here ...Mat image; Image=imread ("/users/cw-it-mini-011/pictures/opencv.jpg",1); Namedwindow ("Display Image", window_autosize); Imshow ("Display Image", image); Waitkey (0); return 0; }
10, run, running successfully.
The reference article mentioned in the beginning mentions the modification of C + + Language dialect. But I have not modified in this demo1, also can compile pass.
Both the C + + Language dialect and the C + + standard library remain the default.
Using OpenCV in Xcode6.4