We need to discuss the following about the gcc compiler:
g++ treats everything as c++ even when the extensions suggest c code (unless told otherwise), and link c++ standard libraries automatically. gcc treats everything according to known extensions (unless told otherwise) and does not automatically link c++ standard libraries.
We need to discuss the following about the
gcc
compiler:-o
flag to specify output file name:pkg-config --cflags --libs opencv
detector
./detector
pkg-config
while compiling.pkg-config --cflags opencv
prints the list of arguments needed to allow the compiler to find the header files, and make necessary links to OpenCVpkg-config --libs opencv
prints the commands needed for linkingg++ -o detector.exe detector.cpp``pkg-config --cflags --libs opencv
g++ -o detector.exe detector.cpp $(pkg-config --cflags --libs opencv)