Get started with iOS development, start with the most basic environment, and today we'll look at how to fully match the OBJECT-C environment.
My Linux system is ubuntu14.04. Given that there is no money to buy a MacBook, the black Apple Computer card can't keep up.
So...
first with environment: sudo apt-get install GNUstep Gnustep-devel GOBJC (Ctrl + ALT + T call out cmd input command, to be networked download)
open .BASHRC ,
sudo gedit. BASHRC (command line)
After opening, add at the bottom
Gnustep_path=/usr/share/gnustep
Export Gnustep_path
source/usr/share/gnustep/makefiles/gnustep.sh
Here, the environment is well equipped to start testing.
To build a simpleHELLOWORLD.MFile input
#import <stdio.h>
int main (int argc, const char * argv[])
{
printf ("Hello world\n");
return 0;
}
and then compilegcc Helloworld.m-o Hello
./helloSuccess
One more.
#import <Foundation/Foundation.h>
int main (int argc, const char *argv[]) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSLog (@ "Hello world!");
[Pool drain];
return 0;
}
This time the compiler should pay attention to, because the reference to the header file, the compilation requires some parameters to succeed, or will report a bunch of errors
GCC ' gnustep-config--objc-flags '-lgnustep-base hello.m-o Hello
Make a Makefile
app:$ (s)
@gcc ' Gnustep-config--objc-flags ' $ (s)-O app-lobjc-lgnustep-base
@./app
@rm *.D
@rm app
Note: The first two sentences are to compile and execute the code
The latter two sentences refer to the deletion of the resulting file
The @ symbol is used here to make the command batch not display text
Run:
CD-To-code path
Run the makefile command followed by the s= file name
linux-ubuntu14.04 OBJECTIVE-C Environment Construction