0

I need to compile a simple display image code in opencv on Ubuntu Linux platform but I am getting some errors as follows:

gcc: error: ‘pkg-config: No such file or directory
gcc: error: opencv‘: No such file or directory
gcc: error: unrecognized option ‘--cflags’
gcc: error: unrecognized option ‘--libs’

please can some one help me?

Simon
  • 4,813
  • 8
  • 35
  • 52
user186851
  • 11
  • 1
  • 1

1 Answers1

0

Please remember to include the command that's producing the error as well.

In this case I am guessing that you copy-pasted the gcc command line from somewhere and the punctuation got mangled

$ gcc -o hello ‘pkg-config --cflags --libs opencv‘ hello.cpp
gcc: error: ‘pkg-config: No such file or directory
gcc: error: opencv‘: No such file or directory
gcc: error: unrecognized option ‘--cflags’
gcc: error: unrecognized option ‘--libs’

The correct punctuation around the pkg-config string should be "backticks" not the forward ticks ‘ ... ‘ that you seem to have i.e.

$ gcc -o hello `pkg-config --cflags --libs opencv` hello.cpp
steeldriver
  • 136,215
  • 21
  • 243
  • 336