Compile OpenCV (2.3.1+) for OS X Lion / Mountain Lion with Xcode

前端 未结 5 695
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 03:50

Can anyone provide me some detailed guide how to compile OpenCV 2.3.1 on OS X Lion with Xcode?

I\'m getting mad about this … I got the source, used cmake to create t

5条回答
  •  心在旅途
    2020-11-30 04:12

    Thanks to Vachidrewer, I was able to get OpenCv running on Mavericks. I did things in a little different order,so here are my notes.

    1. If it isn't installed, install Macports and add it to path. (I already had it installed)

    2. Use Macports to update itself from the command line $ sudo port -v selfupdate

    3. Use Macports to install opencv and its dependencies from the command line. $ sudo port install opencv

    4. If it isn't installed, install xCode. (I already had it installed)

    5. Use xCode to create a C++ Command line project.

    6. Use xCode to verify that the simple hello world C++ program it created works by running it in the xCode IDE.

    7. Modify the main.cpp file created by xCode from the hello world example to the simple opencv example from Vachidrewer.

    8. Notice that xCode editer reports that it can NOT find the header opencv header file.

    9. Add /opt/local/include/ to the project search path and notice that the editer errors go away.

    10. Try to run the program in the xCode IDE and notice that it reports that it can't find the opencv libraries.

    11. Add a group called opencvfrqmework to the project and add /opt/local/lib/libopencv_core.dylib and /opt/local/lib/livopencv_highgui.dylib to the group.

    12. Use the xCode IDE to run the project and notice that a window pops up with half od it darker then the other half.

提交回复
热议问题