[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
linking surprise...
- To: linuxgames@sunsite.dk
- Subject: linking surprise...
- From: Christian Henz <chrhenz@gmx.de>
- Date: Wed, 23 Oct 2002 03:42:40 +0200
- Delivered-To: archiver@seul.org
- Delivered-To: mailing list linuxgames@sunsite.dk
- Delivery-Date: Tue, 22 Oct 2002 22:11:07 -0400
- Mailing-List: contact linuxgames-help@sunsite.dk; run by ezmlm
- Reply-To: linuxgames@sunsite.dk
- User-Agent: Mutt/1.4i
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
cheers,
Christian Henz