Alex winkler
Alex winkler

Reputation: 453

png.h file not found - Linux

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.

Upvotes: 44

Views: 88146

Answers (5)

harbinger
harbinger

Reputation: 124

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

Upvotes: 1

Dan Anderson
Dan Anderson

Reputation: 2345

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

Upvotes: 3

sureshbabu kasthuri
sureshbabu kasthuri

Reputation: 39

For Centos 7 use below

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

    yum install libpng-devel
    

Upvotes: 0

Dev
Dev

Reputation: 441

For centOS 7 you can try

yum -y install libpng* 

Upvotes: 4

J. Chomel
J. Chomel

Reputation: 8395

try rather this:

sudo apt-get install libpng-dev

Then maybe go askubuntu.com ;)

Upvotes: 114

Related Questions