Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I think the easiest way is to create a cmake project and compile your program using cmake. Details are at http://docs.opencv.org/trunk/db/df5/tutorial_linux_gcc_cmake.html (it refers to Linux and gcc, but it's the same on Mac).

Just create a CmakeLists.txt (provided your file is called DisplayImage.cpp):

cmake_minimum_required(VERSION 2.8)
project( DisplayImage )
find_package( OpenCV REQUIRED )
include_directories( ${OpenCV_INCLUDE_DIRS} )
add_executable( DisplayImage DisplayImage.cpp )
target_link_libraries( DisplayImage ${OpenCV_LIBS} )

and then compile your program:

cmake .
make
./DisplayImage