problem in compiling in windows

View: New views
3 Messages — Rating Filter:   Alert me  

problem in compiling in windows

by ychong7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi,

 

I am new to Objective C.  I tried compiling the problem below and got the error message.  I am using MINGW32

 

" hello.m:1:25: objc/object.h: No such file or directory

   hello.m6: error: cannot find interface declaration for 'Object, superclass of 'Hello'

 

 

THks

 

########

 

Problem Example

 

#include <objc/object.h>
#include <stdio.h>


@interface Hello : Object
{ }
+ world;
@end


@implementation Hello
+ world
{
  puts("Hello world !");
}
@end


main()
{
  [Hello world];
}


_______________________________________________
Help-gnustep mailing list
Help-gnustep@...
http://lists.gnu.org/mailman/listinfo/help-gnustep

Re: problem in compiling in windows

by Germán Arias-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi. Well I'm not sure how work only with Objective-C. But, if you
install GNUstep (the installer are here
http://gnustep.org/experience/Windows.html). You need do the fallow
steps

1) Run GNUstep -> Shell. This make the directory GNUstep/home/usuario

2) Make a folder to your project. (for example
GNUstep/home/usuario/example

3) Make one file with this code

        #include <Foundation/Foundation.h>
        #include <stdio.h>

        @interface Hello : NSObject
        {
        }
        +(const char*)world;
        @end


        @implementation Hello
        +(const char*)world
        {
          return "Hello world !";
        }
        @end

        int main(void)
        {
          printf("%s\n", [Hello world]);
          return 0 ;
        }

save this file like, for example, example.m

4) Make a second file with this code

        include $(GNUSTEP_MAKEFILES)/common.make
        TOOL_NAME = example
        example_OBJC_FILES = example.m
        include $(GNUSTEP_MAKEFILES)/tool.make

save this file with the name GNUmakefile

5) In the shell (when you run the shell you are in the place
GNUstep/home/usuario)
     
    cd example
    make

this make the tool example int the folder obj inside the folder example.

6) Now you can run your program, in the shell

        cd obj
        ./example

 
Hello world !

There are more information in
http://gnustep.org/developers/documentation.html




_______________________________________________
Help-gnustep mailing list
Help-gnustep@...
http://lists.gnu.org/mailman/listinfo/help-gnustep

Re: problem in compiling in windows

by Adam Fedor-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Jan 10, 2009, at 9:54 PM, ychong7@... wrote:

 
#include <objc/object.h>
#include <stdio.h>


You need to use

#include <objc/Object.h>

with a capital "O".   Unix (and MinGW)  are case sensitive.

_______________________________________________
Help-gnustep mailing list
Help-gnustep@...
http://lists.gnu.org/mailman/listinfo/help-gnustep