linking stripped object files

Fergus Henderson fjh@cs.mu.OZ.AU
Mon Mar 3 00:29:00 GMT 1997


Chin Chee-Kai, you wrote:
> 
> Suppose now I do this (which works on Unix, producing an executable
> that does not have debugging information):
> 	rm -f a.exe
> 	strip *.o
> 	gcc -g 1.o 2.o 3.o

Which Unix does this work on?

It doesn't work on Linux or Alpha/OSF.

On Alpha/OSF, the `strip' command reports the following:
	strip: Error: 1.o contains relocation entries-- not stripped

On Linux, you just get 

	undefined symbol `main'

or something like that.

> I get:
> C:\CYGNUS\H-I386-CYGWIN32\lib\gcc-lib\i386-cygwin32/cygnus-2.7.2-961023/\
> ../../../../i386-cygwin32/lib/libcygwin.a(libcmain.o): In function `main':
> /pizza/mushroom/noer/beta17/src/winsup/libcmain.cc:30: undefined reference \
> to `WinMain@16'

That's because `strip' stripped off all the symbols including the
`main' symbol in your `.o' file.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: < http://www.cs.mu.oz.au/~fjh >   |  of excellence is a lethal habit"
PGP: finger fjh@128.250.37.3         |     -- the last words of T. S. Garp.
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list