Emacs 25.1 on lubuntu 16.04 will not be configured due to lack of libpng

I am trying to install emacs 25.1 on lubuntu 16.04 and have some problems. After loading and extracting tar, I will go to the emacs 25.1 directory, then .. ./configure

Configuration stops when I receive a 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 a 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 line below that didn't help at all.

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

I am stuck here, I was looking for a lot of time and cannot find any solutions that really worked.

+6
source share
2 answers

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

when gcc compiles emacs, it uses some libpng... found in the Anconda3 directory. Therefore, I delete the linked Anaconda3 directory in PATH , everything works out correctly.

Invalid 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 correct version is:

 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 this will be helpful!

+4
source

The solution is to remove the standard version of libpng-dev (1.2) and explicitly install version 1.6: sudo apt-get remove libpng-dev && sudo apt-get install libpng16-dev

Explicit dependency versions do not seem to be documented in readme files.

+1
source

All Articles