static version of libgcc_s.so.1...

lrtaylor@micron.com lrtaylor@micron.com
Tue Apr 20 16:48:00 GMT 2004


No, using -static-libgcc is not the same as what you have done below.
Try this:

g++ myapp.C -L/path1 -L/path2 -lmySharedLib -o myApp -static-libgcc
-static

Cheers,
Lyle

-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Venkatakrishnan, V
Sent: Tuesday, April 20, 2004 1:39 AM
To: 'Ian Lance Taylor'
Cc: gcc-help@gcc.gnu.org
Subject: RE: static version of libgcc_s.so.1...


Ian,
	I'm doing something like
g++ myapp.C -L/path1 -L/path2 -Wl,-Bstatic -lstdc++ -lgcc -Wl,-Bdynamic
-lmySharedLib -o myApp
	Isn't this what you've mentioned?

	and this still has a dependency on libgcc_s.so.1 as well as
libstdc++.so.4.


	

-----Original Message-----
From: Ian Lance Taylor [mailto:ian@wasabisystems.com]
Sent: Tuesday, April 20, 2004 12:41 PM
To: Venkatakrishnan, V
Cc: gcc-help@gcc.gnu.org
Subject: Re: static version of libgcc_s.so.1...


"Venkatakrishnan, V" <v.venkatakrishnan@sdi.usa.xerox.com> writes:

> 	I'm running into this issue where an application when ported to
a
> target machine NOT having gcc installed, does NOT run and throws the
> following error...
> 
> ld.so.1: MyApp: fatal: libstdc++.so.4: open failed: No such file or
> directory or 
> ld.so.1: MyApp: fatal: libgcc_s.so.4: open failed: No such file or
directory
> 
> 	now, I did try to compile it using libstdc++.a to have that
library
> statically linked to the application, but similarly I CANNOT find
> libgcc_s.a.  Where can I get this from???

Use -static-libgcc when you link.  The file you want is libgcc.a.

Ian



More information about the Gcc-help mailing list