Sunday, 16 August 2009

HOWTO: compile objective-c using gcc in Linux

to compile these examples of objective-c (install libobjc first) from objective-c on

1) traditional:
gcc -c XX.m XXX.m -Wno-import
gcc -o prog XX.o XXX.o -lobjc -Wno-import

2) gcc *.m -lojbc -Wno-import

-Wno-import is because the maintainer of gcc doesn't like 'import';

-lobjc: -l(library) -L(libaray directory) -lobjc(for GNU objective-c libraray)

For those examples using GNUstep, most of the header files need to be changed from ' #import ' to '#import ' to suit the GNU objective-c library.

More details:

No comments:

My photo
London, United Kingdom

Facebook & Twitter