discuss-gnustep
[Top][All Lists]
Advanced

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

Re: GNUstep static compilation?


From: Pete French
Subject: Re: GNUstep static compilation?
Date: Sat, 20 Aug 2005 12:16:27 +0100

> Obj-C is a dynamic language and can't build static binaries. The  
> usual way to get a similar result is to build/assemble an application  
> bundle.

Sorry, but thats simply not true, you can compile and link a static objc
program quite happily. The 'dynamic' bits are all about method and class
lookup, and as long as all the bits are in the binary they work quite happily
when staticly linked. Just give the -static flag to gcc and away you go:

cc -static test.m -lobjc -lpthread
file a.out
a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), for FreeBSD 
5.4, statically linked, not stripped

Whether you can do this with the GNUstep libraries or not I dont know - my
installation certainly seems to only have dynamic libraries installed. But
this is certainly not a problem with Objective C itself.

-bat.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]