Skip to content

Instantly share code, notes, and snippets.

@vicendominguez
Last active August 29, 2015 13:56
Show Gist options
  • Save vicendominguez/8820386 to your computer and use it in GitHub Desktop.
Save vicendominguez/8820386 to your computer and use it in GitHub Desktop.
Compiling a .cpp source with OpenCV libs in MacOSX/Ubuntu 13.04
# MacOS X 10.7.x
# You need opencv is installed (macports)
g++ -ggdb `pkg-config --cflags opencv` `pkg-config --libs opencv` header.cpp header2.cpp program.cpp -o program
# Ubuntu 13.04 / Mint 15
# opencv from source because package version doesn't have nonfree modules separated (SURF/SIFT)
# and you can have problems (install pkg-config too)
g++ -o program program.cpp `pkg-config opencv --cflags --libs`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment