LDFLAGS - working

lrtaylor@micron.com lrtaylor@micron.com
Mon Dec 29 22:46:00 GMT 2003


You can see which shared libraries a shared library is linked to using the ldd command.  I just ran than on libnewt:

[lrtaylor@lrtaylor Library Build System]$ ldd /usr/lib/libnewt.so
        libslang-utf8.so.1 => /usr/lib/libslang-utf8.so.1 (0x4002b000)
        libm.so.6 => /lib/tls/libm.so.6 (0x40090000)
        libc.so.6 => /lib/tls/libc.so.6 (0x42000000)
        libdl.so.2 => /lib/libdl.so.2 (0x400b2000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

The last three libraries are standard and get linked in by default.  The other two do not get linked in by default, so I figured you would need to add them to the command line.

Note that just because the configure script now succeeds (at least for this test) does not mean that the program will compile.  You'll probably end up having to hack the Makefiles to add missing libraries kind of like you did for the configure script...

For libuuid, you'll just need to go through the same process of looking at config.log, see why it failed and then go from there.  Fun, huh? :-)

Cheers,
Lyle

-----Original Message-----
From: Mansour Al-Aqeel [mailto:mansour77@ownmail.net]
Sent: Monday, December 29, 2003 3:41 PM
To: lrtaylor; gcc-help@gcc.gnu.org
Subject: RE: RE: LDFLAGS - working


it's working Lely:
there is another library needed.
Thanks alot. How do you know what libraries are needed by the static one
??
How did you know that's it's libslang ??
that was the case on my system libslang 


checking for newtInit in -lnewt... yes
checking for uuid_generate in -luuid... no
configure: error: GNU nparted requires libuuid
	


On Mon, 29 Dec 2003 15:32:44 -0700, lrtaylor@micron.com said:
> Try it!
> 
> -----Original Message-----
> From: Mansour Al-Aqeel [mailto:mansour77@ownmail.net]
> Sent: Monday, December 29, 2003 3:31 PM
> To: lrtaylor; gcc-help@gcc.gnu.org
> Subject: RE: RE: LDFLAGS
> 
> 
> Ok Lely:
> I think I'm almost there. Now what ??
> here is code section from configure what should I change ??
> Exactely ???
> 
> echo $ac_n "checking for newtInit in -lnewt""... $ac_c" 1>&6
> echo "configure:1010: checking for newtInit in -lnewt" >&5
> ac_lib_var=`echo newt'_'newtInit | sed 'y%./+-%__p_%'`
> if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
>   echo $ac_n "(cached) $ac_c" 1>&6
> else
>   ac_save_LIBS="$LIBS"
> LIBS="-lnewt  -lslang-utf8 -lm  $LIBS"
> cat > conftest.$ac_ext <<EOF
> #line 1018 "configure"
> 
> 
> On Mon, 29 Dec 2003 14:55:07 -0700, lrtaylor@micron.com said:
> > Well, it looks to me that libnewt uses stuff from another library that's
> > not being included on the command line in the test.  That is,
> > SLang_getkey is probably not from libnewt, but libnewt uses another
> > library that defines that symbol (probably libslang-utf8 - at least
> > that's what it's linked to on my system).  The shared version of the
> > library will have been linked to this other library, which would cause it
> > to be linked in automatically when using the shared version.  That's not
> > possible with the static version, however.
> > 
> > In order for the test to succeed, that library would need to be added to
> > the command line for the test.  Reinstalling the RPM or installing the
> > source RPM will not make any difference.  The problem is not with your
> > newt library.  Rather, the problem is with the test for libnewt.  This is
> > a case of a developer expecting the shared library to be used, and so all
> > they worried about was the ability to link to libnewt (like I was saying
> > before).  Unless there's a configure option that will allow you to
> > specify extra libraries to link to (run "./configure --help" to see which
> > options are available to you), or to cause the test to be disabled (so
> > that it just assumes the library is there rather than testing for it),
> > probably the only way that you're going to get this to compile is to edit
> > the configure script to include '-lslang-utf8 -lm' after '-lnewt' in the
> > test.
> > 
> > Do you really need to have this program linked staticall?
> > 
> > Cheers,
> > Lyle
> > 
> > -----Original Message-----
> > From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org]On
> > Behalf Of Mansour Al-Aqeel
> > Sent: Monday, December 29, 2003 2:40 PM
> > To: gcc-help@gcc.gnu.org
> > Subject: RE: LDFLAGS
> > 
> > 
> > Lely
> > here is the last lines in config.log do they tell you any thing. What
> > they are telling me is that the 
> > linker is using that path then, it's going up again to /usr/lib
> > One more thing to mention, is that the error is generated after it finds
> > libnewt.a
> > In other word the rpm package I have on my system doesn't have this
> > feature or options enabled.
> > well, I  installed both the library and it's devel package, then I
> > installed them again from the source
> > code and when they didn't work I removed it and reinstalled the rpm.
> > I think i should try the  source installation after enabling these
> > options. and then we will see.
> > Do u have any better idea ? 
> > 
> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> > configure:958: gcc -E conftest.c
> > configure:977: checking whether gcc accepts -g
> > configure:1010: checking for newtInit in -lnewt
> > configure:1029: gcc -o conftest -g -O2    -static conftest.c -lnewt  
> > 1>&5
> > /usr/lib/gcc-lib/i386-redhat-linux/2.96/../../../libnewt.a(newt.o): In
> > function `newtFlushInput':
> > newt.o(.text+0x51): undefined reference to `SLang_getkey'
> > newt.o(.text+0x5b): undefined reference to `SLang_input_pending'
> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> -- 
>   Mansour Al-Aqeel
>   mansour77@ownmail.net
> 
> -- 
> http://www.fastmail.fm - One of many happy users:
>   http://www.fastmail.fm/docs/quotes.html
-- 
  Mansour Al-Aqeel
  mansour77@ownmail.net

-- 
http://www.fastmail.fm - Or how I learned to stop worrying and
                          love email again



More information about the Gcc-help mailing list