discuss-gnustep
[Top][All Lists]
Advanced

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

Can't Get Program To Compile--Help


From: jokerClay
Subject: Can't Get Program To Compile--Help
Date: Tue, 25 Jan 2011 17:46:35 -0800 (PST)

Hi All,

I am trying to learn Objective-C on a Windows Vista machine.  I have
installed the GNUstep installs for Windows and have successfully compiled a
"Hello World" program.  I thought I was home free to start getting into some
coding until I tried the next tutorial that imported some files i.e.
"Foundation/NSObject.h".  At first, I was getting "Foundation/NSObject.h no
file or directory found" error. After putting in the path to NSObject.h, I'm
now getting all kind of errors with NSObject.h.  To me, there shouldn't be a
problem with NSObject.h.  I'm at a lost.  Below is my code.  Can/Will
someone help me?  Please?

//#import<Foundation/NSObject.h>
#import <C:/GNUStep/GNUstep/System/Library/Headers/Foundation/NSObject.h>
@interface MyClass:NsObject{
}  
    //declare methods for more than one parameter
    -(int) sum: (int) a andb: (int) b andc: (int) c ;
 @end 
--MyClass.h--

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

@implementation MyClass
-(int) sum: (int) a andb: (int) b andc: (int)c;
    {
      return a+b+c;
    }
@end

--MyClass.m--

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

int main()
  {
    MyClass *class = [[MyClass alloc]init];

    printf("Sum is : %d",[class sum : 5 andb : 6 andc: 10]);
    [class release];
    return;  
  }
--MyClassMain.m--
-- 
View this message in context: 
http://old.nabble.com/Can%27t-Get-Program-To-Compile--Help-tp30763711p30763711.html
Sent from the GNUstep - General mailing list archive at Nabble.com.




reply via email to

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