Home  |  Linux  | Mysql  | PHP  | XML
From:John Atkeson Date:Fri Jul 18 05:39:15 2008
Subject:Re: [GD-DEVEL] static linked libgd
  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
Navigate in group php.gd.devel at sever news.php.net
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants