I have an alias defined to compile an opencv program which goes like this
alias gcv='g++ -I/usr/local/include/opencv -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_objdetect'
Then I go on to type
gcv imageshow.cpp
I get this long list of errors
But when I use the same command specified in the alias with the .cpp(source code) file in between the Include and Library files (following the suggestion here), everything works like a charm.
g++ -I/usr/local/include/opencv imageshow.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui
Now typing the long command, which gets even bigger as complexity increases, every time is getting difficult, please help me in getting the alias to work or suggest any other alternative.
g++ imageshow.cpp (pkg-config --cflags --libs opencv)
also try to add a white space at the end of your alias string.pkg-config --cflags --libs opencv
but you appear to missing the necessary packages to develop with opencv, install those packages withsudo apt-get install libopencv-dev
and after that runsudo ldconfig