[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: linking surprise...



On Wed, Oct 23, 2002 at 03:42:40AM +0200, Christian Henz wrote:
> I compiled some SDL+OpenGL code with both gcc/linux and mingw. With 
> mingw, the stripped exe would be < 10KB, while the linux binary was 
> ~40KB (5K and 18K upx'ed). Since I want to port a 64K intro to linux, 
> this bothered me and I thought, maybe I'd better use glut than SDL.
>  
> So i added -lglut to my linker switches just to see how much that would 
> add to the size of the binary... surpsisingly the resulting filesize was 
> only a fraction of the original one! How can this be?  
> 
> 
> # gcc -o timing main.o timer.o process.o -L../basecode_gl -lbasecode_gl 
> -lGL -lGLU -lm `sdl-config --libs`
> # ls -l timing
> -rwxr-xr-x    1 chrissi  chrissi    177638 2002-10-23 03:13 timing
> # strip timing
> # ls -l timing
> -rwxr-xr-x    1 chrissi  chrissi     42072 2002-10-23 03:13 timing
> 
> 
> # gcc -o timing main.o timer.o process.o -L../basecode_gl -lbasecode_gl 
> -lGL -lGLU -lglut -lm `sdl-config --libs`
> # ls -l timing
> -rwxr-xr-x    1 chrissi  chrissi    135462 2002-10-23 03:14 timing
> # strip timing
> # ls -l timing
> -rwxr-xr-x    1 chrissi  chrissi      7764 2002-10-23 03:14 timing
> 

Could you tell me what version of gcc you are using? May not be relevant,
but I'd like to know.

Al

PGP signature