static lib drops objects with side-effects

Elias Athanasopoulos elathan@phys.uoa.gr
Mon Feb 10 17:02:00 GMT 2003


Hello!

On Mon, Feb 10, 2003 at 05:03:04PM +0100, Wesley W. Terpstra wrote:
> g++ main.o libfat.a -o fails
> 	This will NOT include the static_nut and will fail to print output
> 
> This is a bug.

Try this:

% g++ -Wl,--whole-archive libfat.a -Wl,--no-whole-archive main.o -o works

Elias



More information about the Binutils mailing list