[351] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: Drag and Drop, try 1

daemon@ATHENA.MIT.EDU (Arnt Gulbrandsen)
Fri Jun 13 20:43:11 1997

To: gtk-list@redhat.com
From: Arnt Gulbrandsen <agulbra@troll.no>
Date: 14 Jun 1997 02:42:46 +0200
In-Reply-To: Ian Main's message of Fri, 13 Jun 1997 10:31:46 -0700 (PDT)
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

Ian Main <slow@intergate.bc.ca>
> Something interesting to think about :)

Not so very.  You can kill any program in any language by linking in
enough unused libraries.

$ gcc hello_world.c -ldb -lfbm -lform -lg++ -lgdbm -lgdk -lglib -lgtk -ljpeg -lm -lmenu -lncurses -lndbm -lnewt -lpanel -lpbm -lpgm -lpng -lpnm -lppm -lqt -lreadline -lrle -lslang -lsnmp -lstdc++ -ltcl -ltiff -ltk -lvga -lvgagl -lz
$ time ./a.out
hello world
0.27user 0.04system 0:01.20elapsed 25%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (556major+22minor)pagefaults 0swaps

To compile this program as C++, use "gcc -x c++ hello_world.c" or
rename it to hello_world.cpp and just "gcc hello_world.cpp".  I get
the exact same times as for C and C++:

$ gcc hello_world.c
$ time ./a.out
hello world
0.00user 0.00system 0:00.00elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (59major+7minor)pagefaults 0swaps

Next, I compile the program as C++, but without linking in any
libraries the program doesn't use:

$ mv hello_world.c hello_world.cpp
$ gcc hello_world.cpp
hello_world.cpp: In function `int main()':
hello_world.cpp:3: warning: implicit declaration of function `int printf(...)'
$ time ./a.out
hello world
0.00user 0.00system 0:00.00elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (59major+7minor)pagefaults 0swaps

--Arnt

--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post