The installation instruction is here: http://www.gnustep.org/experience/Windows.html
Download GNUstep MSYS System and GNUstep Core. Install them in the same order.
If you didn't change anything within the installation you will find GNUStep folder on your C drive. In this folder you find msys.bat. Launch it or launch Shell in Start->All Programs->GNUStep->Shell.
It's a more or less standard shell. Use vi to type a program. If you prepare a Windows editor, for example Notepad++, you can use it and save the program in /GNUStep/hom/
I began from the simple C-program and compile it ion the shell as:
gcc test.c
Then, I tried a simple Objective-C program:
#include <objc/object.h>Then I compiled it:
#include <stdio.h>
@interface Test : Object
{
}
- (void)sayHello;
@end
@implementation Test
- (void) sayHello
{
printf("Hello from Objective-C class\n");
}
@end
int main(void)
{
id t;
t = [Test new];
[t sayHello];
[t free];
return 0;
}
gcc test.m -lobjc
I got a.exe file and launched it:
Next step - test a Foiundation Tool!
#import <Foundation/Foundation.h>The gcc line looks weird:
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSLog (@"Hello. It's Foundation Tool");
[pool drain];
return 0;
}
$ gcc `gnustep-config --objc-flags` -L /GNUstep/System/Library/Libraries test1.m -o test1.exe -lgnustep-base -lobjc
But then I got the executable that I can launch in the shell:
Helpfull links about the subject:
1. Compile Objective-C Programs Using gcc.
2. Installing and using GNUstep and Objective-C on Windows
No comments:
Post a Comment