[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Foundation.h help
From: |
Tim Kack |
Subject: |
Re: Foundation.h help |
Date: |
Mon, 29 Nov 2010 11:13:24 +0100 |
Hi CBW,
(Resent including gnustep-discuss)
I see that you are using plain GCC to compile.
The easiest way of doing development on windows is to use the GNUstep
Make package instead
(http://www.gnustep.org/resources/documentation/Developer/Make/Manual/make.html).
Basically (you might already done some of these steps, just added for
completeness)
1. Ensure that make, base, bui and back are installed by using the
installers from here: http://www.gnustep.org/experience/Windows.html
2. Create a GNUMakefile in the directory where your main.m lives
according to the make documentation, i.e.
#
# An example GNUmakefile
#
# Include the common variables defined by the Makefile Package
include $(GNUSTEP_MAKEFILES)/common.make
# Build a simple Objective-C program
TOOL_NAME = prog1
# The Objective-C files to compile
prog1_OBJC_FILES = prog1.m
-include GNUmakefile.preamble
# Include in the rules for making GNUstep command-line programs
include $(GNUSTEP_MAKEFILES)/tool.make
-include GNUmakefile.postamble
3. Ensure that GNUstep.sh is sources by typing 'env | grep GNU'
You should see a lot of "GNUSTEP_XXXX_XXX" variable defined.
If they are not defined (which they really should be with after using
the windows installer) - you need to source the GNUstep.sh file like
this:
. /usr/GNUstep/System/Library/Makefiles/GNUstep.sh
4. Type 'make' and see that it starts building.
Then to "install" it, type 'make install' followed by 'make clean'
5. If you run into any issues, type "make message=yes" and capture
output, that makes it easier to troubleshoot.
Best regards,
Tim
On Mon, Nov 29, 2010 at 7:07 AM, <cbw2005@comcast.net> wrote:
> Using a programming book, one of the exercises has me try
> #import <Foundation/Foundation.h>
> int main(int argc, const char * argv[])
> {
> NSAutoreleasePool * Pool = [NSAutoreleasePool alloc] init];
> NSLog (@"programming is fun");
> [pool drain];
> return 0;
> }
> // i am using Windows vista, GNUstep to compile, and jEdit to enter the
> data. i get these errors from GNUstep
> $ gcc -o run prog1.m
> prog1.m:1:34: error: Foundation/Foundation.h: No such file or directory
> prog1.m: In function 'main' :
> prog1.m:5: error: 'NSAutoreleasePool' undeclared (first use in this
> function)
> prog1.m:5: error: (Each undeclared identifier is reported only once
> prog1.m:5: error: for each function it appears in.)
> prog1.m:5: error: 'Pool' undeclared (first use in this function)
> prog1.m:5: error: expected ';' before 'init'
> prog1.m:5: error: expected statement before ']' token
> prog1.m:5: error: cannot find interface declaration for 'NXConstantString'
> prog1.m:5: error: 'pool' undeclared (first use in this function)
>
> //thanks for any help anyone can provide!!
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnustep
>
>