Thursday, February 27, 2014

how to compile opencv on linux (ubuntu)

here is a file (compile.sh) to compile my codes
I have different versions of OpenCv in my system and using 2.4.4 in this case;


#! /bin/bash
PKG_CONFIG_PATH=/usr/local/opencv-2.4.4/lib/pkgconfig:${PKG_CONFIG_PATH}
export PKG_CONFIG_PATH
g++ -o $1 $1.cpp `pkg-config --libs opencv` `pkg-config --cflags opencv`


in order to compile the code type;
./compile.sh <FileNameWithoutExtension>

in order to execute;
./<FileNameWithoutExtension>

No comments:

Post a Comment