I have recently installed GNUstep on an acquaintance's Windows machine and, just like on mine, have not had issues.

Check for a conflicting installation of mingw (such as that found in devcpp or codeblocks, or standalone mingw) might interfere. Uninstall other languages and development environments to check and fix this. You should also check the contents of your PATH environment variable; look up on the web how to do this.

Using full paths in #include statements is invalid; never do this. You can tell the compiler where to find headers by passing - Iwhateverrelativeorfullpathyouneed. This argument can be added in GNUmakefile in OBJC_FLAGS, if I remember correctly. Why is this necessary? NSObject.h depends and includes additional headers which are referred to using relative paths, and hence they are again unfindable.

Regards,

Ivan Vučica
via phone

On 26. sij. 2011., at 02:46, jokerClay <[email protected]> wrote:


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.


_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to