bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Need help


From: vishal bhuva
Subject: Need help
Date: Thu, 15 Oct 2009 18:07:04 +0530

Hello Friends,


Please help me.

I try to use GNUstep for windows and it work for basic program.

but it not work any includeing  file program
for example.

MyClass.h
=========
#import<NSObject.h>

@interface MyClass:NSObject{
    int a;
    int b;
    }
    -(void) setvara : (int) x;
    -(void) setvarb : (int) y;
    -(int) add;
@end


MyClass.m
=========
#import<stdio.h>
#import"MyClass.h"

@implementation MyClass
   -(void) setvara :(int) x{
     a=x;
   }
   -(void) setvarb :(int) y{
     b=y;
   }
   -(int) add{
     return a+b;
   }
@end

main.m
======
#import<stdio.h>

#import"MyClass.m"

int main(){
  MyClass *class = [[MyClass alloc]init];
  [class setvara : 5];
  [class setvarb : 6];
  printf("Sum is : %d",[class add]);
  [class release];
  return ;
}



Please tell me how to compile this program and run it.


It get that error that NSobject.h   No such file or directory

In this simple program
sample.m
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSLog (@”Programming is fun!”);
[pool drain];
return 0;
}

Error
sample.m:1:34: Foundation/Foundation.h: No such file or directory
D:\LEARNING\iphone\ObjectiveC\sample.m: In function `main':
sample.m:4: error: `NSAutoreleasePool' undeclared (first use in this function)
sample.m:4: error: (Each undeclared identifier is reported only once
sample.m:4: error: for each function it appears in.)
sample.m:4: error: `pool' undeclared (first use in this function)
sample.m:5: error: stray '@' in program
sample.m:5: error: stray '\148' in program
sample.m:5: error: `Programming' undeclared (first use in this function)
sample.m:5: error: syntax error before "is"
sample.m:5: error: stray '\148' in program


Please help me and reply soon.

--
Vishal Bhuva
9898235709
Software Expert
Ahmedabad
   INDIA

reply via email to

[Prev in Thread] Current Thread [Next in Thread]