# [OS X TeX] Can't compile - pdflatex issue

David Watson dewatson at me.com
Sun Apr 12 00:09:11 CEST 2009

On Apr 11, 2009, at 3:37 PM, Tim Poitras wrote:

> Hello,
>
> I'm running the MacTex 2008 distribution on my Macbook Pro, and it
> just won't compile.
>
> When I try to compile a .tex file using pdflatex, I get this error:

> dyld: Library not loaded: /sw/lib/libpng12.0.dylib
> Referenced from: /usr/bin/pdflatex
> Trace/BPT trap
>

You have Fink installed, and the paths are overriding the paths set by
MacTeX.
You will need to fix this either by removing the line in your bash
resource files, placing the fink path after your other paths by
editing the appropriate file in the /sw directory, or removing Fink
altogether.

There may be other solutions discussed on this list before, so perhaps
a perusal of the archives would lead to other useful methods of
dealing with Fink.
In other words, MacTex is probably working fine, but the installation
of Fink makes it appear otherwise.

> So I did a find for the missing file "libpng12.0.dylib" and found it
> in a couple other directories. They are:
> /Developer/SDKs/MacOSX10.5.
> sdk/usr/X11/lib/libpng12.0.dylib
> /usr/X11/lib/libpng12.0.dylib
>
> So I copied the file out of there (the 1st directory I listed) and
> into the /usr/bin directory. I then tried to run pdflatex again and
> got this error:
>
> dyld: Library not loaded: /sw/lib/libpng12.0.dylib
> Referenced from: /usr/bin/pdflatex
> Reason: no suitable image found. Did find:
> /sw/lib/libpng12.0.dylib: can't map
> Trace/BPT trap
>
> Has anyone seen this before? Any advice on how I can get this to work?
>

Yes, many times on this very list.

> I even tried this with the most basic of .tex files possible:
>
> \documentclass{article}
> \begin{document}
> hello world!
> \end{document}
>
> and it can't even compile that.
>
> I googled a lot, and still can't find a solution.
>
> Thanks.