Compiling simple OpenCV in Linux - No Such file or directory

asked 2016-07-11 22:36:46 -0600

benn gravatar image

I understand opencv is installed on the stock debian 8.4 distro included with the beaglebone black:
i.e. pkg-config --modversion opencv returns 2.4.9.1

However, when I try to compile a simple hello-world test file:
g++ -O2 'pkg-config --cflags --libs opencv' test.cpp -o test

I get an error that there is no such file or directory for opencv,
g++: error: pkg-config --cflags --libs opencv: No such file or directory

I'm running as root, but is there someother setup (path, folder permissions) that need to be done?

I'm following the tutorial/code directly from here: http://derekmolloy.ie/beaglebone/beag...

Thanks!

edit retag flag offensive close merge delete

Comments

  • make sure to use backticks ( ` ) , not apostophe( ' )
  • what does pkg-config --cflags --libs opencv alone, on the cmdline, retrieve ?
berak gravatar imageberak ( 2016-07-11 23:39:04 -0600 )edit

Good catch, I'm using backticks in the code. Interestingly, when I do the pkg-config line alone (no file) I get an unexpected warnings about lame!

ex. libmp3lame.so.0 needed by //usr/lib/arm-linux-gnueabihf/libavcodec.so not found http://pastebin.com/dLWJaCed

Why is it looking for lame/mp3 files to compile what would be opencv?

benn gravatar imagebenn ( 2016-07-12 23:05:40 -0600 )edit