0

I'm a newbie in Objective-C. I'm trying to compile Objective-C with GNUstep but it's giving errors. I tried to both compile on command line (gcc and makefile).

No such file or directory /
excepted '>' before 'GSPredicateBlock'
…

I used the command line

gcc gnustep-config --objc-flags -o hello hello.m -I /GNUstep/System/Library/Headers -L /GNUstep/System/Library/Libraries -lobjc -lgnustep-base -fconstant-string-class=NSConstantString -enable-auto-import

My attempt at using a makefile:

Making all for tool Hello...
Compiling file hello.m ...
hello.m:1:71 fatal error: ../../GNUstep/System/Library/Headers/Foundation/Found ation.h: No such file or directory
compilation terminated.
make[3]: *** [obj/Hello.obj/hello.m.o] Error 1
make[2]: *** [internal-tool-all_] Error 2
make[1]: *** [Hello.all.tool.variables] Error 2
make: *** [internal-all] Error 2

I've searched Google, but I can't find anything that helps. I installed gnustep-msys-system-0.28.0-setup, gnustep-core-0.28.0-setup and gnustep-devel-1.3.0-setup on Windows 7.

Gilles 'SO- stop being evil'
  • 104,111
  • 38
  • 209
  • 254
miniplayground
  • 301
  • 2
  • 12
  • Error is : No such file or directory / excepted '>' before 'GSPredicateBlock' and more. I use gcc `gnustep-config --objc-flags` -o hello hello.m -I /GNUstep/System/Library/Headers -L /GNUstep/System/Library/Libraries -lobjc -lgnustep-base -fconstant-string-class=NSConstantString -enable-auto-import in commandline – miniplayground May 20 '11 at 02:48
  • I would suggest writing a Makefile for GNUstepMake. This eliminates compiler commands which could possibly be wrong. For an example see here: http://www.gnustep.it/nicola/Tutorials/WritingMakefiles/index.html – MKroehnert May 20 '11 at 08:07
  • I'm try do this(Makefile for GNUstepMake) but it have an same error.What will I do? Tell me please. – miniplayground May 20 '11 at 08:58
  • When I compile hello.m it have an error and got hello.d don't have .exe.What about this. – miniplayground May 23 '11 at 03:24
  • Making all for tool Hello... Compiling file hello.m ... hello.m:1:71 fatal error: ../../GNUstep/System/Library/Headers/Foundation/Found ation.h: No such file or directory compilation terminated. make[3]: *** [obj/Hello.obj/hello.m.o] Error 1 make[2]: *** [internal-tool-all_] Error 2 make[1]: *** [Hello.all.tool.variables] Error 2 make: *** [internal-all] Error 2 – miniplayground May 24 '11 at 02:05
  • Maybe you should update your question and add the code you want to compile together with the makefile you are using and the error output which results from running make. – MKroehnert May 24 '11 at 08:44
  • Ok,Thank you all.It's just work fine when I'm reinstall again :) – miniplayground May 25 '11 at 05:12
  • The error messages in your first command are obviously copied manually, given the spelling errors. **Always copy-paste error messages**. – Gilles 'SO- stop being evil' Jul 07 '12 at 20:59

1 Answers1

0

I don't know if this is a red herring but I see there's a space in a place where it should not be:

Foundation/Found ation.h

it should read:

#import <Foundation/Foundation.h>

(without the space) in your source code file

Obviously this is what the compiler complains about here:

hello.m:1:71 fatal error: ../../GNUstep/System/Library/Headers/Foundation/Found ation.h: No such file or directory

remove that space in your source code file's import directive and try again.

SqAR.org
  • 557
  • 6
  • 15