Size: 180
Comment:
|
← Revision 4 as of 2016-11-10 10:57:18 ⇥
Size: 2105
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 5: | Line 5: |
== Example with gcc-obj == | == Example with gcc and gnustep == |
Line 7: | Line 7: |
/* http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-make-2.6.8.tar.gz http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-base-1.24.9.tar.gz http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-gui-0.25.0.tar.gz http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-back-0.25.0.tar.gz gcc -lgnustep-base -lobjc main.m -o main -L /usr/GNUstep/Local/Library/Libraries -I /usr/GNUstep/System/Library/Headers/ -fconstant-string-class=NSConstantString */ #import <Foundation/Foundation.h> #import <stdlib.h> #import <stdio.h> @interface Hello:NSObject - (void)greet:(char *)msg msg2:(NSString *)msg2; @end @implementation Hello - (void)greet:(char *)msg msg2:(NSString *)msg2 { printf("Hello, World! %s %s \n", msg, [msg2 cString] ); NSLog(@"Hello, World! %s %@", msg , msg2 ); } @end int main(void) { NSString *str1 = @"ijk"; id myhello = [ [Hello alloc] init]; [ myhello greet:"GNUStep ..." msg2:str1 ]; [ myhello release ]; return EXIT_SUCCESS; } |
|
Line 8: | Line 40: |
== Installation using source code == {{{#!highlight bash cd /tmp wget http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-make-2.6.8.tar.gz wget http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-base-1.24.9.tar.gz wget http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-gui-0.25.0.tar.gz wget http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-back-0.25.0.tar.gz su tar xvzf gnustep-make-2.6.8.tar.gz cd gnustep-make-2.6.8 ./configure make clean make make install ldconfig cd /tmp tar xvzf gnustep-base-1.24.9.tar.gz cd gnustep-base-1.24.9 ./configure make clean make make install ldconfig cd /tmp tar xvzf gnustep-gui-0.25.0.tar.gz cd gnustep-gui-0.25.0 ./configure make clean make make install ldconfig cd /tmp tar xvzf gnustep-back-0.25.0.tar.gz cd gnustep-back-0.25.0 ./configure make clean make make install ldconfig }}} |
ObjectiveC
Example with gcc and gnustep
1 /*
2 http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-make-2.6.8.tar.gz
3 http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-base-1.24.9.tar.gz
4 http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-gui-0.25.0.tar.gz
5 http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-back-0.25.0.tar.gz
6
7 gcc -lgnustep-base -lobjc main.m -o main -L /usr/GNUstep/Local/Library/Libraries -I /usr/GNUstep/System/Library/Headers/ -fconstant-string-class=NSConstantString
8 */
9
10 #import <Foundation/Foundation.h>
11 #import <stdlib.h>
12 #import <stdio.h>
13
14 @interface Hello:NSObject
15 - (void)greet:(char *)msg msg2:(NSString *)msg2;
16 @end
17
18 @implementation Hello
19 - (void)greet:(char *)msg msg2:(NSString *)msg2 {
20 printf("Hello, World! %s %s \n", msg, [msg2 cString] );
21 NSLog(@"Hello, World! %s %@", msg , msg2 );
22 }
23 @end
24
25 int main(void) {
26 NSString *str1 = @"ijk";
27 id myhello = [ [Hello alloc] init];
28 [ myhello greet:"GNUStep ..." msg2:str1 ];
29 [ myhello release ];
30 return EXIT_SUCCESS;
31 }
Installation using source code
1 cd /tmp
2 wget http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-make-2.6.8.tar.gz
3 wget http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-base-1.24.9.tar.gz
4 wget http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-gui-0.25.0.tar.gz
5 wget http://ftpmain.gnustep.org/pub/gnustep/core/gnustep-back-0.25.0.tar.gz
6 su
7
8 tar xvzf gnustep-make-2.6.8.tar.gz
9 cd gnustep-make-2.6.8
10 ./configure
11 make clean
12 make
13 make install
14 ldconfig
15
16 cd /tmp
17 tar xvzf gnustep-base-1.24.9.tar.gz
18 cd gnustep-base-1.24.9
19 ./configure
20 make clean
21 make
22 make install
23 ldconfig
24
25 cd /tmp
26 tar xvzf gnustep-gui-0.25.0.tar.gz
27 cd gnustep-gui-0.25.0
28 ./configure
29 make clean
30 make
31 make install
32 ldconfig
33
34 cd /tmp
35 tar xvzf gnustep-back-0.25.0.tar.gz
36 cd gnustep-back-0.25.0
37 ./configure
38 make clean
39 make
40 make install
41 ldconfig