Re: [GD-DEVEL] static linked libgd

From: Date: Fri, 18 Jul 2008 11:39:15 +0000
Subject: Re: [GD-DEVEL] static linked libgd
References: 1  Groups: php.gd.devel 
Request: Send a blank email to php-gd-devel+get-453@lists.php.net to get a copy of this message
Some compilers also need the -lm option to link math.h. E.G. try this: gcc lines2jpg.c -lgd -ljpeg -lm -static On Fri, Jul 18, 2008 at 7:04 AM, Yann Zoll <yzoll@ifm-geomar.de> wrote: > Hi, > > i am new to GD and also to C. I am trying to write a small programm that > manipulates an image by adding some text and some simple drawings. The > programm will be used on several computers, so i try to link all the libs > statically. > > When i try to compile my test program with > > gcc lines2jpg.c -lgd -ljpeg -static > > the compiler says > > ############# > /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../lib64/libgd.a(gd.o): In > function `lsqrt': > (.text+0x319a): undefined reference to `sqrt' > /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../lib64/libgd.a(gd.o): In > function `gdImageCopyRotated': > (.text+0x3207): undefined reference to `sqrt' > /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../lib64/libgd.a(gd.o): In > function `gdImageCopyRotated': > (.text+0x322c): undefined reference to `cos' > /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../lib64/libgd.a(gd.o): In > function `gdImageCopyRotated': > (.text+0x3240): undefined reference to `sin' > /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../lib64/libgd.a(gd.o): In > function `gdImageDashedLine': > (.text+0x3f74): undefined reference to `atan2' > /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../lib64/libgd.a(gd.o): In > function `gdImageDashedLine': > (.text+0x3f79): undefined reference to `sin' > /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../lib64/libgd.a(gd.o): In > function `gdImageDashedLine': > (.text+0x4089): undefined reference to `atan2' > /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../lib64/libgd.a(gd.o): In > function `gdImageDashedLine': > (.text+0x408e): undefined reference to `sin' > /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../lib64/libgd.a(gd.o): In > function `gdImageLine': > (.text+0x46b6): undefined reference to `atan2' > /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../lib64/libgd.a(gd.o): In > function `gdImageLine': > (.text+0x46bb): undefined reference to `cos' > /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../lib64/libgd.a(gd.o): In > function `gdImageLine': > (.text+0x477b): undefined reference to `atan2' > /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../lib64/libgd.a(gd.o): In > function `gdImageLine': > (.text+0x4780): undefined reference to `sin' > collect2: ld returned 1 exit status > #################### > > I also included <math.h> but the result is the same. Any help is apreciated! > > Thanks, Yann > > -- > GD Devel Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- John http://jca3.freeshell.org/dmi

« previous php.gd.devel (#453) next »