[wplug] libraries

Chris chris.romano at verizon.net
Tue Mar 11 21:51:58 EST 2003


That was it.

Thank you so much.  It would have taken me forever to figure that one out.

Thanks,
Chris

-----Original Message-----
From: wplug-admin at wplug.org [mailto:wplug-admin at wplug.org]On Behalf Of
Brian S. Woolstrum
Sent: Tuesday, March 11, 2003 9:34 PM
To: wplug at wplug.org
Subject: Re: [wplug] libraries


On Tue, 11 Mar 2003, Chris wrote:

>
>
> I am trying to write a little c program and I think that it's getting
> confused with linking the libraries.
>
> It is using the gd, libpng, and zlib libraries.  I had older version on my
> system (RH 7.2) so I download the source for the newer versions and did
the
> whole ./configure make make install.  Now what I am guessing is that the
new
> installation put the libraries in a different location from where the
> originals are.  How can I tell.  I included the correct header "gd.h".
>
> When I try to compile it, I get the following errors:
>
> test.o: In function `main':
> test.o(.text+0xe): undefined reference to `gdImageCreate'
> test.o(.text+0x24): undefined reference to `gdImageColorAllocate'
> test.o(.text+0x43): undefined reference to `gdImageColorAllocate'
> test.o(.text+0x61): undefined reference to `gdImageLine'
> test.o(.text+0x8c): undefined reference to `gdImagePng'
> test.o(.text+0xa8): undefined reference to `gdImageDestroy'
> collect2: ld returned 1 exit status
>
> It's been a while since I used C so I am very rusty.
>
> Thanks,
> Chris
>
> _______________________________________________
> wplug mailing list
> wplug at wplug.org
> http://www.wplug.org/mailman/listinfo/wplug
>

I'm not familiar with the gd library. Its also hard to tell
for sure since you didn't put in a copy of the command line
you compiled with, but I would guess that you are
forgetting to tell the linker to link with the library.
Including the header is usually only half of what it takes,
try "gcc -lgd myprog.c -o myprog"

_______________________________________________
wplug mailing list
wplug at wplug.org
http://www.wplug.org/mailman/listinfo/wplug




More information about the wplug mailing list