You are not logged in.

#1 2015-08-23 19:11:20

Marot
Member
Registered: 2015-08-23
Posts: 3

Latex and libpng do not work together

Hi all,
I have the following problem:
I can not include .png graphics in my latex files.
When I try to run

pdflatex foo.tex

and foo.tex includes the line

\includegraphics{pic.png}

I get the following error:

pdflatex: relocation error: pdflatex: symbol png_set_option, version PNG16_0 not defined in file libpng16.so.16 with link time reference

output of latex -version:

pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2014/Arch Linux)
kpathsea version 6.2.0
Copyright 2014 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.6.16; using libpng 1.6.18
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with poppler version 0.33.0

All packages should be up to date. Just did a pacman -Syu.
Maybe "Compiled with libpng 1.6.16; using libpng 1.6.18" this is a problem? It would be very nice if someone can help me.

Offline

#2 2015-08-23 21:02:31

Techmeology
Member
Registered: 2012-08-21
Posts: 19

Re: Latex and libpng do not work together

Occasionally, mirrors can get out of sync, however I seem to have the latest versions of texlive and libpng. I wonder if your libpng has become corrupt somehow. If this is the case, simply reinstall it:

pacman -S libpng

If this doesn't work, I'd be interested to see what

nm -D /usr/lib/libpng16.so.16 | grep PNG16_0

produces. On my system:

0000000000000000 A PNG16_0

Offline

#3 2015-08-23 21:27:25

Marot
Member
Registered: 2015-08-23
Posts: 3

Re: Latex and libpng do not work together

Hi Techmeology, thanks for your answer.
I already tried reinstalling libpng and texlive-core.
for

nm -D /usr/lib/libpng16.so.16 | grep PNG16_0

i get

00000000 A PNG16_0

I think the missing zeroes are because I use a 32bit system?

And there is also

00009910 T png_set_option

Offline

#4 2015-08-23 22:05:08

Marot
Member
Registered: 2015-08-23
Posts: 3

Re: Latex and libpng do not work together

OK I'm sorry,
there was something missing.
It works, when I call "pdflatex foo.tex" out of the console.

Let me explain:
I use sublime-text as editor. In there I have a Makefile project. And only if I execute this Makefile directly out of sublime I get the error described in the first post.
When I call the makefile from the command line everything is working fine.

So it seems it has something to do with sublime.

So I think I will post my problem in the sublime forum.

Offline

#5 2016-02-16 18:02:18

twerkmeister
Member
Registered: 2016-02-16
Posts: 1

Re: Latex and libpng do not work together

Hi Marot,

not sure if you ever solved this problem, but I ran into it today, too. I found out that the sublime-text package provides it's own (outdated) libpng version

 pacman -Ql sublime-text 

returns

....
sublime-text /opt/sublime-text/lib/
sublime-text /opt/sublime-text/lib/libpng.so
sublime-text /opt/sublime-text/lib/libpng16.so
sublime-text /opt/sublime-text/lib/libpng16.so.16
sublime-text /opt/sublime-text/lib/libpng16.so.16.2.0
sublime-text /opt/sublime-text/lib/python26.zip
....

and in fact png_set_option is not in there. As a quick fix I went with

cd /opt/sublime-text
sudo cp -R lib lib.bak
cd lib
sudo ln -sf /usr/lib/libpng.so libpng16.so.16.2.0

Certainly not nice, but a way to upgrade this outdated libpng version. So far, I didn't run into troubles and the build from inside sublime text works again

Offline

Board footer

Powered by FluxBB