opencv compile c++

C++
pkg-config --cflags --libs /path/to/opencv.pc
//to compile opencv code samples
Source

Also in C++: