[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Mingw-cross-env-list] gd undefined references
From: |
Volker Grabsch |
Subject: |
Re: [Mingw-cross-env-list] gd undefined references |
Date: |
Sat, 23 Oct 2010 08:58:32 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
super pollo <address@hidden> schrieb:
> 2010/10/22 Volker Grabsch <address@hidden>:
> > super pollo <address@hidden> schrieb:
> >> $ i686-pc-mingw32-gcc -lgd -lpng -lz -ljpeg -lfreetype -lm gd1.c
> >>
> >> but i got this:
> >>
> >> /tmp/ccmNaNdn.o:gd1.c:(.text+0x26): undefined reference to address@hidden'
> >
> > You have to add the "-DNONDLL" option:
> >
> > i686-pc-mingw32-gcc -lgd -lpng -lz -ljpeg -lfreetype -lm -DNONDLL gd1.c
>
> nope:
>
> $ i686-pc-mingw32-gcc -lgd -lpng -lz -ljpeg -lfreetype -lm -DNONDLL gd1.c
> /tmp/ccYl8lxj.o:gd1.c:(.text+0x1e): undefined reference to `_gdImageCreate'
> [...]
Sorry, I forgot to mention that "gd1.c" should be noted before the libs:
i686-pc-mingw32-gcc gd1.c -lgd -lpng -lz -ljpeg -lfreetype -lm -DNONDLL
> > Note that the "gdlib-config" script provides almost all options
> > you need, so you could also use the following command:
> >
> > i686-pc-mingw32-gcc gd1.c -lgd `.../usr/i686-pc-mingw32/bin/gdlib-config
> > --cflags --libs`
>
> nope:
>
> $ i686-pc-mingw32-gcc gd1.c -lgd `gdlib-config --cflags --libs`
> /tmp/cc40GgWU.o:gd1.c:(.text+0xea): undefined reference to `_gdImagePng'
Here you are using the native "gdlib-config" of your system. However,
you need the one of the cross toolchain! That's what I denoted as
".../usr/" in the example command above.
Also note that Mingw-cross-env's ".../usr/i686-pc-mingw32/bin/" directory
is _not_ in the PATH and should _never_ be added to PATH.
BTW, don't confuse that with ".../usr/bin/" (outside of the "i686-pc-mingw32/"
directory), which _is_ meant to be added to PATH.
Greets,
Volker
--
Volker Grabsch
---<<(())>>---