Compilation Error:ObjecticeC on Windows XP using GNUStep

Discussion in 'Mac Programming' started by atif37, Oct 16, 2008.

  1. atif37 macrumors newbie

    Joined:
    Oct 16, 2008
    #1
    I am a newbie to GNUStep and ObjectiveC stuff. I started working on ObjectiveC but i dont have Mac, i read somewhere that ObjectiveC programs can be compiled and run on Windows using GNUStep. So i downloaded two packages from the following link

    http://www.gnustep.org/experience/Windows.html

    which contains MSYS/MinGW System and GNUstep Core. First i installed the MSYS/MinGW System and then GNUStep core. GNU Core is installed inside the root folder of MSYS/MinGW. These two packages are installers and i guess i dont have to manually go through the 'make and install' process of all the required component within each package.

    I wrote a hello world application and run it successfully in MinGW shell using the command 'gcc -o hello hello.m' and then './hello'.

    Then i wrote another application which has an interface file i.e. '.h' for class, an implementation file for the class(.m) and another(.m) containing 'main' method for the application. The interface file contains a statement 'import <Foundation/NSObject.h>'.

    when i try to compile the application using 'gcc -o main main.m' but it throws an error 'Foundation/NSObject.h: No such file or directory'. Some other applications were throwing the same kinda errors not finding the GNUStep files.

    I even tried to compile after running usr/GNUstep/System/Library/Makefiles/GNUstep.sh, but had no luck. I have no clue at all where im going wrong. Please help me with this.

    Thnak you very very much in advance.

    Tiff
     
  2. garethlewis2 macrumors 6502

    Joined:
    Dec 6, 2006
    #2
    The gnustep web site will give you detailed instructions on how to build using the command line.

    gcc -o main main.m, you err might need to include a library, sort of like, -l objc, then tell gnustep where the Foundation framework is stored.

    On OS X, it would be gcc -o main main.m -l objc -framework Foundation, but I doubt that is going to work on gnustep.
     
  3. eglyph macrumors newbie

    Joined:
    Oct 17, 2008
    #3
    This usually means that include paths on your system are not complete.

    First of all I assume you work under MSYS shell.

    Issue a 'set' command and the prompt and look what's your ${INCLUDE} looks like.

    Find out where is your NSObject.h resides. Check whether its path is in ${INCLUDE}. If it's not there ajust your ${INCLUDE} as needed. Or you might set the correct parameter for gcc in makefile.

    Actually, I was thinking on the same thing as you (getting familiar with Mac programming not having any Mac), so if you have any progress on this, please, report back.
     
  4. zazzy macrumors newbie

    Joined:
    Nov 6, 2008
    #4

Share This Page