to compile these examples of objective-c (install libobjc first) from objective-c on wikipedia.org
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
Note:
-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
More details: http://www.cs.indiana.edu/classes/c304/oop-intro.html
No comments:
Post a Comment