public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: LDFLAGS -static
@ 2003-12-29 17:37 lrtaylor
  2003-12-29 20:18 ` Mansour Al-Aqeel
  0 siblings, 1 reply; 4+ messages in thread
From: lrtaylor @ 2003-12-29 17:37 UTC (permalink / raw)
  To: mansour77, gcc-help

There could be at least a couple different problems.  First, are you
sure there's a static version of libnewt there?  If so, it may be that
the program you are compiling was not properly set up for static
linking.  Normally, if the developer is just thinking about dynamic
linking, they often don't worry about the order that libraries are
specified on the link command line, which is fine for dynamic linking.
However, when linking statically, order does matter, and each library
needs to appear on the command line after everything else that uses that
library (even other libraries), or the symbols defined in that library
will not get found properly.  It's possible that in your case, libnewt
is specified too early on the command line and simply needs to be moved
to the end.

Good luck,
Lyle

-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Mansour Al-Aqeel
Sent: Sunday, December 28, 2003 7:06 AM
To: gcc-help@gcc.gnu.org
Subject: LDFLAGS -static

Hi every body:
I'm having a problem configuring a program for a static compilation.
I'm using the command

LDFLAGS="--static -I/usr/lib" CC="diet gcc -nostdinc" ./configure \
--prefix=~/result --disable-shared --enable-all-static --disable-nls

how ever i keet on getting an error complainig about the need for
libnewt.
the library is there. I installed it from rpm packages with it's devel
package.

I've tried adding CPPFLAGS="-L/usr/include"

I've tried searching the archieve before asking.
any advice about how to solve this, or a place where I can get more
about
this situation ??
but no luck. I'm using redhat 7.3
By the way, I'm not an expert in compiling and linking .
Thanx alot. 
-- 
  Mansour Al-Aqeel
  mansour77@ownmail.net

-- 
http://www.fastmail.fm - A no graphics, no pop-ups email service

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: LDFLAGS -static
  2003-12-29 17:37 LDFLAGS -static lrtaylor
@ 2003-12-29 20:18 ` Mansour Al-Aqeel
  0 siblings, 0 replies; 4+ messages in thread
From: Mansour Al-Aqeel @ 2003-12-29 20:18 UTC (permalink / raw)
  To: gcc-help


On Mon, 29 Dec 2003 10:37:44 -0700, lrtaylor@micron.com said:

Thaks alot Lyle for replaying:

The static built of the labrary is there libnewt.a
the program I'm tring to build in nparted for partitioning a disk.
there is no error message I'm getting except for this library.
configure script stops before checking other libraries.
I dont know what did you mean by th elibrary is specified too early.
do you mean that i should 've done it this way ??

CFLAGS=-I/usr/include  CPPFLAGS=-I/usr/lib LDFLAGS=--static ./configure
--prefix=./here

if that's what you mean, I did't. I tried every thing. now I'm having the
sam eproblem compiling 
dialog statically the same way. Does that help ??
I did this to make sure 
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib:/usr/lib/:/usr/local/lib

I'm still trying to figure out what's wrong. Any help is heighly
appretiated
Again thanx alot for your help.

> There could be at least a couple different problems.  First, are you
> sure there's a static version of libnewt there?  If so, it may be that
> the program you are compiling was not properly set up for static
> linking.  Normally, if the developer is just thinking about dynamic
> linking, they often don't worry about the order that libraries are
> specified on the link command line, which is fine for dynamic linking.
> However, when linking statically, order does matter, and each library
> needs to appear on the command line after everything else that uses that
> library (even other libraries), or the symbols defined in that library
> will not get found properly.  It's possible that in your case, libnewt
> is specified too early on the command line and simply needs to be moved
> to the end.
> 
> Good luck,
> Lyle
>

 
> -----Original Message-----
> From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
> Behalf Of Mansour Al-Aqeel
> Sent: Sunday, December 28, 2003 7:06 AM
> To: gcc-help@gcc.gnu.org
> Subject: LDFLAGS -static
> 
> Hi every body:
> I'm having a problem configuring a program for a static compilation.
> I'm using the command
> 
> LDFLAGS="--static -I/usr/lib" CC="diet gcc -nostdinc" ./configure \
> --prefix=~/result --disable-shared --enable-all-static --disable-nls
> 
> how ever i keet on getting an error complainig about the need for
> libnewt.
> the library is there. I installed it from rpm packages with it's devel
> package.
> 
> I've tried adding CPPFLAGS="-L/usr/include"
> 
> I've tried searching the archieve before asking.
> any advice about how to solve this, or a place where I can get more
> about
> this situation ??
> but no luck. I'm using redhat 7.3
> By the way, I'm not an expert in compiling and linking .
> Thanx alot. 
> -- 
>   Mansour Al-Aqeel
>   mansour77@ownmail.net
> 
> -- 
> http://www.fastmail.fm - A no graphics, no pop-ups email service
-- 
  Mansour Al-Aqeel
  mansour77@ownmail.net

-- 
http://www.fastmail.fm - A fast, anti-spam email service.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: LDFLAGS -static
@ 2003-12-29 20:32 lrtaylor
  0 siblings, 0 replies; 4+ messages in thread
From: lrtaylor @ 2003-12-29 20:32 UTC (permalink / raw)
  To: mansour77, gcc-help

What is the actual error you are receiving?  Can you also post the
command line that is generating the error (not the configure command
line, but the actual command line that is getting executed during
build)?

What I meant is that when linking a program, you have something like
this:

gcc -o prog file1.o file2.o -L/some/path -llibrary1 -llibrary2

When linking dynamically, the ordering of the files and libraries is
pretty much irrelevant.  However, when linking statically, the libraries
used should appear on the command line after all the source (object)
files.  And, if any of the libraries depend on another library on the
command line, they should come after the libraries they depend on.  For
example, if library2 uses library1 in the example above, then they would
be ordered backwards as they are.

However, to fix that, you would need to hack the Makefiles after running
your configure script.  First post the actual error and the command line
producing it.  Then we can go from there.

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 1:18 PM
To: gcc-help@gcc.gnu.org
Subject: RE: LDFLAGS -static


On Mon, 29 Dec 2003 10:37:44 -0700, lrtaylor@micron.com said:

Thaks alot Lyle for replaying:

The static built of the labrary is there libnewt.a
the program I'm tring to build in nparted for partitioning a disk.
there is no error message I'm getting except for this library.
configure script stops before checking other libraries.
I dont know what did you mean by th elibrary is specified too early.
do you mean that i should 've done it this way ??

CFLAGS=-I/usr/include  CPPFLAGS=-I/usr/lib LDFLAGS=--static ./configure
--prefix=./here

if that's what you mean, I did't. I tried every thing. now I'm having
the
sam eproblem compiling 
dialog statically the same way. Does that help ??
I did this to make sure 
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib:/usr/lib/:/usr/local/lib

I'm still trying to figure out what's wrong. Any help is heighly
appretiated
Again thanx alot for your help.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* LDFLAGS -static
@ 2003-12-28 14:05 Mansour Al-Aqeel
  0 siblings, 0 replies; 4+ messages in thread
From: Mansour Al-Aqeel @ 2003-12-28 14:05 UTC (permalink / raw)
  To: gcc-help

Hi every body:
I'm having a problem configuring a program for a static compilation.
I'm using the command

LDFLAGS="--static -I/usr/lib" CC="diet gcc -nostdinc" ./configure \
--prefix=~/result --disable-shared --enable-all-static --disable-nls

how ever i keet on getting an error complainig about the need for
libnewt.
the library is there. I installed it from rpm packages with it's devel
package.

I've tried adding CPPFLAGS="-L/usr/include"

I've tried searching the archieve before asking.
any advice about how to solve this, or a place where I can get more about
this situation ??
but no luck. I'm using redhat 7.3
By the way, I'm not an expert in compiling and linking .
Thanx alot. 
-- 
  Mansour Al-Aqeel
  mansour77@ownmail.net

-- 
http://www.fastmail.fm - A no graphics, no pop-ups email service

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-12-29 20:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-29 17:37 LDFLAGS -static lrtaylor
2003-12-29 20:18 ` Mansour Al-Aqeel
  -- strict thread matches above, loose matches on Subject: below --
2003-12-29 20:32 lrtaylor
2003-12-28 14:05 Mansour Al-Aqeel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).