View Full Version : compiling under linux
MrFusion
Jul 28, 2008, 05:51 AM
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.
pilotError
Jul 28, 2008, 08:25 AM
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.
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
MrFusion
Jul 28, 2008, 10:36 AM
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.
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.
Here's a sample I picked up off the web, take a look and see if it helps.
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
Thanks.
I tried it, but I get that "Foundation/Foundation.h" is not found.
Cromulent
Jul 28, 2008, 03:21 PM
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.
kainjow
Jul 28, 2008, 04:17 PM
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.
I think you're thinking of CoreFoundation ;)
Cromulent
Jul 28, 2008, 04:33 PM
I think you're thinking of CoreFoundation ;)
Ah, you are correct :). Disregard my post.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.