Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

png.h file not found - Linux

Tags:

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.

like image 304
Alex winkler Avatar asked Apr 17 '16 09:04

Alex winkler


4 Answers

try rather this:

sudo apt-get install libpng-dev

Then maybe go askubuntu.com ;)

like image 188
J. Chomel Avatar answered Nov 15 '22 01:11

J. Chomel


For centOS 7 you can try

yum -y install libpng* 
like image 35
Dev Avatar answered Nov 15 '22 01:11

Dev


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

like image 2
Dan Anderson Avatar answered Nov 15 '22 02:11

Dan Anderson


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

like image 1
harbinger Avatar answered Nov 15 '22 02:11

harbinger