Sign in Join

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

Mailing lists / lazarus / 1999-08

.so not static?

16 messages · 6 people ·

Reply by email Subscribe to this list Your subscription

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

Samuel Liddicott
to Samuel Liddicott: Dunno. If it was ppc386 reporting the error I would say yes, but it isn't. It looks like…
Show quoted text 8 lines
-----Original Message----- From: Samuel Liddicott Sent: 13 August 1999 12:03 PM To: Subject: RE: [lazarus] Nearly there. /usr/bin/ld: cannot open -lgtk: No such file or directory

OK, I rollod my own ld to print the args and found them to be:

ld -dynamic-linker=/lib/ld-linux.so.2 -o ./lazarus ./link.res

So it seems link.res is the problem file. Lo, and behold at the bottom of ./link.res is:

-lXi
-lXext
-lX11
-lm
-lgtk
-lgdk
-lglib
-lc

Hmm. Why does it only complain about -lgtk? I delete a few lines from the file and find it complains about -lg*

I think its because all my gtk, gdk, glibs are .so and perhaps this is trying to static link.

How do I tell it to dynamic link?

Sam

Reply by email

Samuel Liddicott
to Pascal Dutilleul: Shouldn't taht be -Flgtk or -Fl$GTK or something ? Pascal…
Show quoted text 14 lines
-----Original Message----- From: Pascal Dutilleul Sent: 13 August 1999 11:49 AM To: Subject: Re: [lazarus] Nearly there. > /usr/bin/ld: cannot open -lgtk: No such file or > directory > Shouldn't taht be -Flgtk or -Fl$GTK or something ?

Dunno. If it was ppc386 reporting the error I would say yes, but it isn't. It looks like the commandline args from ppc386 that were passed to the linker weren't massaged correctly. -lgtk would be correct for gcc and it would pass gtk on to the linker.

The point is, I don't know where it gets -lgtk from, its nothing to do with me, and I can't find the refernce with any ammount of greps on things.

Sam

Reply by email

Marc Weustink
to Samuel Liddicott: OK, I rollod my own ld to print the args and found them to be: ld…

At 14:18 13-08-99 +0200, Michael Van Canneyt

Show quoted text 40 lines
On Fri, 13 Aug 1999, Samuel Liddicott wrote: > > -----Original Message----- > > From: Samuel Liddicott > > Sent: 13 August 1999 12:03 PM > > To: > > Subject: RE: [lazarus] Nearly there. > > > > /usr/bin/ld: cannot open -lgtk: No such file or > > directory > > OK, I rollod my own ld to print the args and found them to be: > > ld -dynamic-linker=/lib/ld-linux.so.2 -o ./lazarus ./link.res > > So it seems link.res is the problem file. Lo, and behold at the bottom of > ./link.res is: > > -lXi > -lXext > -lX11 > -lm > -lgtk > -lgdk > -lglib > -lc > > Hmm. Why does it only complain about -lgtk? I delete a few lines from the > file and find it complains about -lg* > > I think its because all my gtk, gdk, glibs are .so and perhaps this is > trying to static link. > > How do I tell it to dynamic link? Add -k-Bdynamic to the compiler options. '-k' tells the compiler to add whatever comes after it to the linker options. But it seems to me that you are on a aout system, and my guess is that the gtk.so libraries are ELF shared libraries; in that case you cannot link them to your binary.

??? Sound familiar. When you look at he options for ld it says

-l<ar> Add an archive file ar to the list of files to link. This option may be used any number of times. ld will search its path-list for occurrences of lib<ar>.a for every ar specified.

So it looks like ld is looking for some .a libs, which arent there (at leats i do not have them, it's aout?)

I just replaced every occurance of -lX by path to its .so couter part and it worked. It didn't bother about the ins an outs of why.

Marc

Reply by email

Peter Vreman
to Samuel Liddicott: Hmm. Thanks; yep this does build static too. I bet my RPM does actually, it probably…
Show quoted text 23 lines
> I simply went to www.gtk.org and downloaded their Stable version > of 1.2. It's at > ftp://ftp.gtk.org/pub/gtk/v1.2 > gtk+-1.2.3.tar.gz and glib-1.2.3.tar.gz Hmm. Thanks; yep this does build static too. I bet my RPM does actually, it probably just doesn't package them. Strangely for ./config said this: checking if the linker (/usr/bin/ld) is GNU ld... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking command to parse /usr/bin/nm -B output... ok checking how to hardcode library paths into programs... immediate checking for /usr/bin/ld option to reload object files... -r checking dynamic linker characteristics... Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes So... why is it that lazarus/ppc386 can't do shared libraries? Is it just that it can't, or I have to do some magic alteration? Or I have to wait for some later makefiles?

At least the makefiles in RTL,FCL,LCL can make sharedlibs already. Try 'make sharedlib' in each of the directories. And then copy the generated .so into /usr/lib or /usr/local/lib and run ldconfig after it. To compile then with the shared versions of the units add -XD to the commandline.

This will give you a hello example of 10k and lazarus of about 40k. (for exact sizes see my previous mail about shared linking working)

Peter

Reply by email

Michael Van Canneyt
to Samuel Liddicott: OK, I rollod my own ld to print the args and found them to be: ld…
Samuel Liddicott wrote 34 lines
> -----Original Message----- > From: Samuel Liddicott > Sent: 13 August 1999 12:03 PM > To: > Subject: RE: [lazarus] Nearly there. > > /usr/bin/ld: cannot open -lgtk: No such file or > directory OK, I rollod my own ld to print the args and found them to be: ld -dynamic-linker=/lib/ld-linux.so.2 -o ./lazarus ./link.res So it seems link.res is the problem file. Lo, and behold at the bottom of ./link.res is: -lXi -lXext -lX11 -lm -lgtk -lgdk -lglib -lc Hmm. Why does it only complain about -lgtk? I delete a few lines from the file and find it complains about -lg* I think its because all my gtk, gdk, glibs are .so and perhaps this is trying to static link. How do I tell it to dynamic link?

Add -k-Bdynamic to the compiler options. '-k' tells the compiler to add whatever comes after it to the linker options.

But it seems to me that you are on a aout system, and my guess is that the gtk.so libraries are ELF shared libraries; in that case you cannot link them to your binary.

Michael.

Reply by email

Samuel Liddicott
to Shane Miller: I simply went to www.gtk.org and downloaded their Stable version of 1.2. It's at…
Show quoted text 11 lines
-----Original Message----- From: Shane Miller Sent: 13 August 1999 02:56 PM To: Subject: Re: RE: Very Nearly I simply went to www.gtk.org and downloaded their Stable version of 1.2. It's at ftp://ftp.gtk.org/pub/gtk/v1.2 gtk+-1.2.3.tar.gz and glib-1.2.3.tar.gz

Hmm. Thanks; yep this does build static too. I bet my RPM does actually, it probably just doesn't package them.

Strangely for ./config said this:

checking if the linker (/usr/bin/ld) is GNU ld... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking command to parse /usr/bin/nm -B output... ok checking how to hardcode library paths into programs... immediate checking for /usr/bin/ld option to reload object files... -r checking dynamic linker characteristics... Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes
checking whether to build static libraries... yes

So... why is it that lazarus/ppc386 can't do shared libraries? Is it just that it can't, or I have to do some magic alteration? Or I have to wait for some later makefiles?

Thanks

Sam

Reply by email

Pascal Dutilleul
Show quoted text 14 lines
> > /usr/bin/ld: cannot open -lgtk: No such file or > > directory > > > > Shouldn't taht be -Flgtk or -Fl$GTK or something ? Dunno. If it was ppc386 reporting the error I would say yes, but it isn't. It looks like the commandline args from ppc386 that were passed to the linker weren't massaged correctly. -lgtk would be correct for gcc and it would pass gtk on to the linker.

After building gtk, shouldn't you have to copy *.ppu somewhere ? (..../units ? )

_________________________________________________________ Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

Reply by email

Peter Vreman
to Samuel Liddicott: Lot of emails from me... OK, where can I download some GTK static libs? I already have…
you wrote 12 lines
Lot of emails from me... OK, where can I download some GTK static libs? I already have gnome installed as binary RPMS. I'm just downloading gtk+-1.2.3-2.src.rpm gtk+10-1.0.6-5.src.rpm gtk-engines-0.5-16.src.rpm To compile and install. Are these the right versions for lazarus? They are a couple of notches up from what I have now, and hopefully will build static libs too as I think that is what lazarus needs.

No, lazarus can be dynamicly linked. I even managed to get all the FPC units from the RTL,FCL and LCL directories to be placed in shared libs and link against those libs.

You don't need the source rpms but the development rpms.

Reply by email

Samuel Liddicott
to Samuel Liddicott: Lot of emails from me... OK, where can I download some GTK static libs? I already have…

Lot of emails from me...

OK, where can I download some GTK static libs? I already have gnome installed as binary RPMS. I'm just downloading

gtk+-1.2.3-2.src.rpm
gtk+10-1.0.6-5.src.rpm
gtk-engines-0.5-16.src.rpm

To compile and install. Are these the right versions for lazarus? They are a couple of notches up from what I have now, and hopefully will build static libs too as I think that is what lazarus needs.

Sam

Reply by email

Samuel Liddicott
to Michael Van Canneyt: Add -k-Bdynamic to the compiler options. '-k' tells the compiler to add whatever comes…
Show quoted text 10 lines
-----Original Message----- From: Behalf Of Michael Van Canneyt Sent: 13 August 1999 01:19 PM To: Subject: RE: [lazarus] .so not static? Add -k-Bdynamic to the compiler options. '-k' tells the compiler to add whatever comes after it to the linker options.

I have tried adding -Bdynamic when calling the linker by hand but it still complained about not finding -lgtk until I removed -lgtk -lgdk -lglib from the lazarus.res file, then it link OK but core dumps on running. I tried also adding lots of -shared /usr/lib/libgtk.so.1 etc etc, but the same - core dumps.

But it seems to me that you are on a aout system, and my guess is that the gtk.so libraries are ELF shared libraries; in that case you cannot link them to your binary.

Surely not! Redhat5.2 out of the box this is; and if gnome can link to the libgtk.so.1 why not lazarus?

# file ppc386
ppc386: ELF 32-bit LSB executable, Intel 80386, version 1, statically linked, not stripped

And ppc386 runs OK.

Sam

Reply by email

Peter Vreman
to Shane Miller: I simply went to www.gtk.org and downloaded their Stable version of 1.2. It's at…
you wrote
I simply went to www.gtk.org and downloaded their Stable version of 1.2. It's at ftp://ftp.gtk.org/pub/gtk/v1.2 gtk+-1.2.3.tar.gz and glib-1.2.3.tar.gz

You should install the devel pacakages:

gtk+-devel-1.2.1-10.i38... 781 Kb Mon May 31 12:36:00 1999

the same goes for glib ofcourse and all other libs you want to develop for. Normally these devel packages also contain the static libary version.

Please add this to HowTo, that you need to install the devel packages, maybe even including the links for the .rpm's which most ppl use.

Peter

Show quoted text 29 lines
Shane >>> "Samuel Liddicott" 08/13 7:04 AM >>> Lot of emails from me... OK, where can I download some GTK static libs? I already have gnome installed as binary RPMS. I'm just downloading gtk+-1.2.3-2.src.rpm gtk+10-1.0.6-5.src.rpm gtk-engines-0.5-16.src.rpm To compile and install. Are these the right versions for lazarus? They are a couple of notches up from what I have now, and hopefully will build static libs too as I think that is what lazarus needs. Sam _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Shane Miller

I simply went to www.gtk.org and downloaded their Stable version of 1.2. It's at ftp://ftp.gtk.org/pub/gtk/v1.2
gtk+-1.2.3.tar.gz and glib-1.2.3.tar.gz

Shane

>> "Samuel Liddicott" 08/13 7:04 AM >>>

Lot of emails from me...

OK, where can I download some GTK static libs? I already have gnome installed as binary RPMS. I'm just downloading

gtk+-1.2.3-2.src.rpm
gtk+10-1.0.6-5.src.rpm
gtk-engines-0.5-16.src.rpm

To compile and install. Are these the right versions for lazarus? They are a couple of notches up from what I have now, and hopefully will build static libs too as I think that is what lazarus needs.

Sam

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Samuel Liddicott
to Pascal Dutilleul: After building gtk, shouldn't you have to copy *.ppu somewhere ? (..../units ? )…
Show quoted text 9 lines
-----Original Message----- From: Pascal Dutilleul Sent: 13 August 1999 12:57 PM To: Subject: RE: [lazarus] Nearly there. After building gtk, shouldn't you have to copy *.ppu somewhere ? (..../units ? )

No. Anyway lazarus uses ../gtk in its NEEDUNITDIR

The trouble is I have not gtk static libs, only .so but lazarus is being built for static.

I tried doing

ld -dynamic-linker=/lib/ld-linux.so.2 -shared -o ./lazarus ./link.res

but then it core dumps when I run it.

I try

ld -dynamic-linker=/lib/ld-linux.so.2 -Bdynamic -o ./lazarus ./link.res but I'm not sure how to specify shared libraries to the linker.

Sam

Reply by email

Samuel Liddicott
to Marc Weustink: At 14:18 13-08-99 +0200, Michael Van Canneyt ??? Sound familiar. When you look at he…
Show quoted text 18 lines
-----Original Message----- From: Marc Weustink Sent: 13 August 1999 06:29 PM To: Subject: RE: [lazarus] .so not static? ??? Sound familiar. When you look at he options for ld it says -l<ar> Add an archive file ar to the list of files to link. This option may be used any number of times. ld will search its path-list for occurrences of lib<ar>.a for every ar specified. So it looks like ld is looking for some .a libs, which arent there (at leats i do not have them, it's aout?) I just replaced every occurance of -lX by path to its .so couter part and it worked. It didn't bother about the ins an outs of why.

Ah. What I was told to do was to create symbollic links from the long-version-containing filename (libglib..so.2.1.0 or something) to libglib.so and that did it (or installing the .dev rpm does the same thing).

So it seems the linker looks for .a or .so and works fine, and either as you do explicitly set the present .so name, or as I was told to set a short .so name will work.

Thanks

Sam

Reply by email