Re: ld/Xm/Xt question
On Mon, Jun 21, 1999 at 07:21:14AM -0700, [EMAIL PROTECTED] wrote: A few weeks ago I wrote and asked about a problem with X on Slink. Due to the under whelming response (including the developers list, except for Oleg who did give me some useful info) I upgraded to XFree 3.3.3 from the netgod.net site. My test case, at first it appeared to fix the problem but my main app was still broken. I noticed by reading the straces of the application runs that on my test case that worked I had -lXm before -lXt, and the main app had -lXT -lXm on the compile line. Both cases compiled cleanly, without warnings or errors, just the app with -lXt -lXm would seg fault and with -lXm -lXt the app would run sucessfully. In general the order of the -l options is important, at least if you have interlibrary dependencies, which is almost always the case with X applications. The highest level libraries are listed first, followed by lower level libraries until at the end you have libraries that do not depend on anything else (except maybe the C library, which is linked by default except in unusual circumstances). Consider the output of gtk-config --libs: -L/usr/lib -L/usr/X11R6/lib -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm Here we see that we high-level GTK+ and GDK libraries come first, followed by intermediate libs, and finally wrapping up with libX11 (the core X protocol library) and the math library, which of course won't be needing any symbols from fancy GUI libraries. -- G. Branden Robinson |A committee is a life form with six or Debian GNU/Linux |more legs and no brain. [EMAIL PROTECTED] |-- Robert Heinlein cartoon.ecn.purdue.edu/~branden/ | pgpKJIfgnBnYt.pgp Description: PGP signature
Re: ld/Xm/Xt question
That's normal - I don't know enough to tell you why, but when linking X libs, x11 goes last, Xt next and then Xm first (or Xaw for athena): -lXm -lXt -lX11 That's the way it is and it is documented in various basic intros to X (see http://www.rahul.net/kenton/xsites.framed.html for loads of stuff on X programming, etc., including on-line X tutorials). HTH, Martin From: [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: debian-user@lists.debian.org Subject: ld/Xm/Xt question Date: Mon, 21 Jun 1999 07:21:14 -0700 (MST) A few weeks ago I wrote and asked about a problem with X on Slink. Due to the under whelming response (including the developers list, except for Oleg who did give me some useful info) I upgraded to XFree 3.3.3 from the netgod.net site. My test case, at first it appeared to fix the problem but my main app was still broken. I noticed by reading the straces of the application runs that on my test case that worked I had -lXm before -lXt, and the main app had -lXT -lXm on the compile line. Both cases compiled cleanly, without warnings or errors, just the app with -lXt -lXm would seg fault and with -lXm -lXt the app would run sucessfully. Is this a problem with the loader/linker or Lesstif or in XFree? -- Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] /dev/null __ Get Your Private, Free Email at http://www.hotmail.com
ld/Xm/Xt question
A few weeks ago I wrote and asked about a problem with X on Slink. Due to the under whelming response (including the developers list, except for Oleg who did give me some useful info) I upgraded to XFree 3.3.3 from the netgod.net site. My test case, at first it appeared to fix the problem but my main app was still broken. I noticed by reading the straces of the application runs that on my test case that worked I had -lXm before -lXt, and the main app had -lXT -lXm on the compile line. Both cases compiled cleanly, without warnings or errors, just the app with -lXt -lXm would seg fault and with -lXm -lXt the app would run sucessfully. Is this a problem with the loader/linker or Lesstif or in XFree?
Re: ld/Xm/Xt question
-BEGIN PGP SIGNED MESSAGE- On Mon, 21 Jun 1999 [EMAIL PROTECTED] wrote: snip my test case that worked I had -lXm before -lXt, and the main app had -lXT -lXm on the compile line. Both cases compiled cleanly, without warnings or errors, just the app with -lXt -lXm would seg fault and with -lXm -lXt the app would run sucessfully. Is this a problem with the loader/linker or Lesstif or in XFree? I think this is more of a linker/loader problem. Not only that, but I don't think it's Linux specific. I believe you'll run into similar problems on most Unix variations. Actually, I think that in many cases your app will fail to link at all if you have -lXt before -lXm. I could be mistaken, as I haven't used many non-GNU based systems lately. noah PGP public key available at http://lynx.dac.neu.edu/home/httpd/n/nmeyerha/mail.html or by 'finger -l [EMAIL PROTECTED]' -BEGIN PGP SIGNATURE- Version: 2.6.2 iQCVAwUBN26Xf4dCcpBjGWoFAQFiZAP9FeVqVscH5O/OsjbFK3PB6PTvOdJgBjLQ 6UDwjQn+R32yKitDrQ3iSjDd10xVm250Z0HJnttRzZCPQY8X5dUUVzBzt5vvCm8r N2pOVuqAiBMc4sICtXlGD9ikOGybOatf8Rh7nHwCTAfrB0ls6c75VJbt/GbMYSdW GS4tl0+WEYo= =nBf8 -END PGP SIGNATURE-