Suddenly I want to try writing in object-C.ProgramIn IOS. So I found the object-C environment on the Internet. The gnustep platform and GCC are used for cross-compilation. The basic components of gnustop are as follows:
Gnustep-make
Gnustep-Base
Gnustep-Gui
Gnustep-back
For Windows platforms, cygwin, mingw, msys, and other UNIX-like virtual platforms are also included.
But in Linux, you only need one source code package to install it all, which is very convenient!
Such as: http://wiki.gnustep.org/index.php/Startup
Gnustep has a test tool to test whether the installation environment is faulty. Run gnustep-Tests directly.
In all order, try my first object-C program: helloworld. M.
# Import <Foundation/Foundation. h> int main (char argc, char * argv []) {nslog (@ "Hello World"); Return 0 ;}
Compile:
Gcc-O helloworld. m-fconstant-string-class = nsconstantstring-I/gnustep/system/library/headers/-L/gnustep/system/library/libraries/-lobjc-lgnustep-Base
Run:
[Root @ cross] # lshelloworld helloworld. M [root @ bogon test] #./helloworld2013-1-21 03:34:58. 355 helloworld [22916] Hello world [root @ cross] #