compiling under linux

Discussion in 'Mac Programming' started by MrFusion, Jul 28, 2008.

  1. MrFusion macrumors 6502a

    Joined:
    Jun 8, 2005
    Location:
    West-Europe
    #1
    Hello,

    I have a CML program, using obj-c and foundation. Everything works fine under my Mac, even on the command line. There are no compilation errors or runtime errors.

    gcc -framework Foundation -Wall classA.m classB.m -o programmeName

    Now I have to compile this programme under linux for a colleague. He installed gnustep and foundation libraries (Ubuntu), however he still gets an error if he runs the above command:
    gcc: Foundation: No such file or directory
    gcc: error trying to exec 'cc1obj': execvp: No such file or directory
    gcc: error trying to exec 'cc1obj': execvp: No such file or directory

    All help is appreciated.
     
  2. pilotError macrumors 68020

    pilotError

    Joined:
    Apr 12, 2006
    Location:
    Long Island
    #2
    I thought the linux version used compiler switches versus the framework parameter. There should also be some sample make files laying around. If I remember correctly, the GNUStep stuff ships with a make infrastructure to make it easier to compile. Here's a sample I picked up off the web, take a look and see if it helps.

    Code:
    gcc-3.0 -c  test.m -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1   -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1 -DGSWARN -O2 -fgnu-runtime -Wall    -I. -I/usr/lib/GNUstep/System/Headers -fgnu-runtime -I/usr/lib/GNUstep/System/Headers -fconstant-string-class=NSConstantString -I/usr/local/lib/GNUstep/Local/Library/Headers -I/usr/local/lib/GNUstep/Network/Library/Headers -I/usr/lib/GNUstep/System/Library/Headers -I/usr/local/lib/GNUstep/Network/Headers/gnustep -I/usr/local/lib/GNUstep/Local/Headers/gnustep -I/usr/lib/GNUstep/System/Headers/gnustep  -I/usr/local/lib/GNUstep/Network/Headers/ix86/linux-gnu -I/home/timo/GNUstep/Headers/ix86/linux-gnu -I/usr/local/lib/GNUstep/Local/Headers/ix86/linux-gnu -I/usr/lib/GNUstep/System/Headers/ix86/linux-gnu -I/home/timo/GNUstep/Headers -I/usr/local/lib/GNUstep/Local/Headers -I/usr/local/lib/GNUstep/Network/Headers -I/usr/lib/GNUstep/System/Headers  -o test.o
    
    
     
  3. MrFusion thread starter macrumors 6502a

    Joined:
    Jun 8, 2005
    Location:
    West-Europe
    #3
    No idea. I never had to do anything more complicated than
    compiler inputfile outputfile
    ./outputfile
    After this basic stuff, I went to xCode which takes care of more complicated and larger projects. I never did anything with make files and such.
    The programme I have to compile now, is also fairly easy. It has just two classes and that is it.

    Thanks.
    I tried it, but I get that "Foundation/Foundation.h" is not found.
     
  4. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #4
    The foundation framework is an Apple framework surely? Most of that is just old Carbon APIs that have been brought up to date and lay the foundation for other Cocoa frameworks.

    I didn't think GNUstep supported it.
     
  5. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #5
    I think you're thinking of CoreFoundation ;)
     
  6. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #6
    Ah, you are correct :). Disregard my post.
     

Share This Page