Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs 25.1 on lubuntu 16.04 won't configure due to missing libpng

Tags:

emacs

emacs25

I am attempting to install emacs 25.1 on lubuntu 16.04, and having some trouble. After downloading and extracting the tar, I navigate to the emacs 25.1 directory then.. ./configure

The configuration stops when I receive the message

configure: error: The following required libraries were not found:
    libpng
Maybe some development libraries/packages are missing?
If you don't want to link with them give
     --with-png=no
as options to configure

When I try sudo apt install libpng-dev

I get the message

Note, selecting 'libpng12-dev' instead of 'libpng-dev' libpng12-dev is already the newest version (1.2.54-1ubuntu1). 0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded. I tried reinstalling libpng12-dev using the below string, which didn't help at all.

sudo apt-get install --reinstall libpng12-0=1.2.54-1ubuntu1

I'm stuck here, I've googled around for a while and can't find any solutions that have actually worked.

like image 206
Aaron Crump Avatar asked Oct 15 '16 23:10

Aaron Crump


1 Answers

I have the same problem. After I checked the config.log file, I found out that because I already installed Anaconda3 python

when gcc compile emacs it uses some libpng... found in Anconda3 directory. So I remove related Anaconda3 directory in PATH, everything turns out right.

The wrong version:

configure:15301: result: -lz
configure:15407: checking for png
configure:15437: gcc -o conftest  -g3 -O2 -I/etc/anaconda3/include/libpng16       conftest.c -lpng16 -lz -lm -lX11   >&5 
/usr/bin/ld: cannot find -lpng16

The right version:

configure:15301: result: -lz
configure:15407: checking for png
configure:15437: gcc -o conftest  -g3 -O2 -I/usr/include/libpng12       conftest.c -lpng12 -lz -lm -lX11   >&5 
configure:15437: $? = 0
configure:15452: result: yes

Hope that would be helpful!

like image 77
wslsqo0e Avatar answered Nov 10 '22 00:11

wslsqo0e