43

I am trying to run this in linux ubuntu. When I type make it says

rgb_image.cc:26:24: fatal error: libpng/png.h: No such file or directory
 #include <libpng/png.h>

Then i followed this to install png.h.

sudo install libpng-dev

But now its telling me

install: missing destination file operand after ‘libpng-dev’

What do I do?

Please help, thanks.

5 Answers 5

114

try rather this:

sudo apt-get install libpng-dev

Then maybe go askubuntu.com ;)

4

For centOS 7 you can try

yum -y install libpng* 
3

With Ubuntu 18, /usr/include/png.h moved to /usr/include/libpng/png.h A workaround is this: ln -s /usr/include/libpng/png.h /usr/include/png.h

Or you can configure your build to use include directory /usr/include/libpng

1

For Centos 8, I got the below warning message :

Warning: Header file <png.h> not found. This host has no libpng library. Disabling support for PNG framebuffers.

and I solved it using the command :

sudo yum install libpng-devel

0

For Centos 7 use below

  • libpng-devel : Development tools for programs to manipulate PNG image format files

    yum install libpng-devel
    
1
  • 1
    What is the difference compared to the above?
    – J. Chomel
    Commented Sep 17, 2018 at 5:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.