Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2003-09

/usr/bin/ld: cannot find -lgd errorr

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Andy Sy

I've noticed that in many of the example programs that come with FreePascal, trying to compile them results in an link error where ld claims it cannot find a particular library (I'm getting one for gd) even though the
corresponding library file is present in

/usr/local/lib/fpc/1.0.10/units/linux/libxxx

From searching the archives, it seems that this is due to the actual library itself missing (at least for other libraries like mysql and postgres). What then are the file like gd.o, libgd.a, libpgd.ppu for? Are they just stubs? And what exactly do they do?

It would probably be a good idea to expand the FAQ entry regarding 'cannot find vga' into one that covers this particular situation or put said info in a README in the examples directory.

Reply by email

Unknown author
to Andy Sy
Andy Sy wrote 13 lines
I've noticed that in many of the example programs that come with FreePascal, trying to compile them results in an link error where ld claims it cannot find a particular library (I'm getting one for gd) even though the corresponding library file is present in /usr/local/lib/fpc/1.0.10/units/linux/libxxx From searching the archives, it seems that this is due to the actual library itself missing (at least for other libraries like mysql and postgres). What then are the file like gd.o, libgd.a, libpgd.ppu for? Are they just stubs? And what exactly do they do?

The libgd.ppu file contains only the definitions of the library entry points and definitions of all types.

The libgd.o file normally contains translated C macros.

The libgd.a file should be the actual C library installed on your system ?

It would probably be a good idea to expand the FAQ entry regarding 'cannot find vga' into one that covers this particular situation or put said info in a README in the examples directory.

The error can have several causes.

Michael.

Reply by email

Marco van de Voort
to Unknown author
Show quoted text 11 lines
> the actual library itself missing (at least for other > libraries like mysql and postgres). What then are the > file like gd.o, libgd.a, libpgd.ppu for? Are they just > stubs? And what exactly do they do? The libgd.ppu file contains only the definitions of the library entry points and definitions of all types. The libgd.o file normally contains translated C macros. The libgd.a file should be the actual C library installed on your system ?

If there is such a file in FPC's dirs, it only contains smartlinking versions of the C macros.

Reply by email

Georgi Georgiev
to Andy Sy: I've noticed that in many of the example programs that come with FreePascal, trying to…

--- Andy Sy wrote: > I've noticed
that in many of the example programs

Show quoted text 19 lines
that come with FreePascal, trying to compile them results in an link error where ld claims it cannot find a particular library (I'm getting one for gd) even though the corresponding library file is present in /usr/local/lib/fpc/1.0.10/units/linux/libxxx From searching the archives, it seems that this is due to the actual library itself missing (at least for other libraries like mysql and postgres). What then are the file like gd.o, libgd.a, libpgd.ppu for? Are they just stubs? And what exactly do they do?

May be the problem is that the linker can't find the corresponding header files of the actual library.

I'm using Debian and the followng sequence of
actions solves such problems:

1. Installing standart FreePascal system:

apt-get install fp-compiler .... # install
FreePascal
apt-get install binutils # install assembler

2. Installing some actual library (postgresql as an example):

apt-get install postgresql # PostgreSQL itself
apt-get install postgresql-dev # header files for libpq

The last step (installing the *-dev package) is the solution (in my opinion) !

=====
Skelet
====== http://skelet.hit.bg

________________________________________________________________________ Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://mail.messenger.yahoo.co.uk

Reply by email

Marco van de Voort
to Georgi Georgiev
Show quoted text 27 lines
> file like gd.o, libgd.a, libpgd.ppu for? Are they > just > stubs? And what exactly do they do? May be the problem is that the linker can't find the corresponding header files of the actual library. I'm using Debian and the followng sequence of actions solves such problems: 1. Installing standart FreePascal system: apt-get install fp-compiler .... # install FreePascal apt-get install binutils # install assembler 2. Installing some actual library (postgresql as an example): apt-get install postgresql # PostgreSQL itself apt-get install postgresql-dev # header files for libpq The last step (installing the *-dev package) is the solution (in my opinion) !

While this is correct (installing the dev package can fix these kind of problems), what actually is needed from the dev packages are not the headers but the static library (the .a file). The "normal" package (without -deve) is the dynamic library (.so file)

Reply by email