Obj-C on Linux
There is a file called Foundation.h, and it has the proper contents, it's just not being found by gcc.
It's at /usr/GNUstep/System/Headers/Foundation/Foundation.h
It's at /usr/GNUstep/System/Headers/Foundation/Foundation.h
Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
I browsed GCC's docs, and set the environment variable OBJC_INCLUDE_PATH to /usr/GNUstep/System/Headers/
Now it shows this:
Thanks,
Steven
Now it shows this:
Quote:main.m:1:2: warning: #import is obsolete, use an #ifndef wrapper in the header file
In file included from /usr/GNUstep/System/Headers/Foundation/Foundation.h:29,
from main.m:1:
/usr/GNUstep/System/Headers/Foundation/NSObjCRuntime.h:112:32: base/objc-gnu2next.h: No such file or directory
In file included from main.m:1:
/usr/GNUstep/System/Headers/Foundation/Foundation.h:30:22: GSConfig.h: No such file or directory
In file included from /usr/GNUstep/System/Headers/Foundation/NSDebug.h:30,
from /usr/GNUstep/System/Headers/Foundation/Foundation.h:31,
from main.m:1:
/usr/GNUstep/System/Headers/Foundation/NSObject.h:39:26: base/preface.h: No such file or directory
/usr/GNUstep/System/Headers/Foundation/NSObject.h:40:22: GSConfig.h: No such file or directory
In file included from /usr/GNUstep/System/Headers/Foundation/Foundation.h:39,
from main.m:1:
/usr/GNUstep/System/Headers/Foundation/NSByteOrder.h:27:22: GSConfig.h: No such file or directory
In file included from /usr/GNUstep/System/Headers/Foundation/Foundation.h:39,
from main.m:1:
/usr/GNUstep/System/Headers/Foundation/NSByteOrder.h:32: parse error before "NSSwappedFloat"
/usr/GNUstep/System/Headers/Foundation/NSByteOrder.h:33: parse error before "NSSwappedDouble"
/usr/GNUstep/System/Headers/Foundation/NSByteOrder.h:53: parse error before "GSSwapI16"
/usr/GNUstep/System/Headers/Foundation/NSByteOrder.h:53: parse error before "in"
/usr/GNUstep/System/Headers/Foundation/NSByteOrder.h:55: parse error before "GSSwapI32"
/usr/GNUstep/System/Headers/Foundation/NSByteOrder.h:55: parse error before "in"
/usr/GNUstep/System/Headers/Foundation/NSByteOrder.h:57: parse error before "GSSwapI64"
/usr/GNUstep/System/Headers/Foundation/NSByteOrder.h:57: parse error before "in"
/usr/GNUstep/System/Headers/Foundation/NSByteOrder.h:59: parse error before "GSSwapI128"
... lots of similar errors omitted from NSByteOrder.h ...
In file included from /usr/GNUstep/System/Headers/Foundation/NSDecimalNumber.h:31,
from /usr/GNUstep/System/Headers/Foundation/Foundation.h:49,
from main.m:1:
/usr/GNUstep/System/Headers/Foundation/NSDecimal.h:30:22: GSConfig.h: No such file or directory
main.m:141:2: warning: no newline at end of file
Thanks,
Steven
Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
Find that base directory and add its parent to the header search paths.
Ok, thanks. After adding that and a few other directories to the search path, it compiles. But, the linker barfs up:
Steven
Quote:/tmp/ccL6nm6c.o: In function `main':for thousands of lines. I think I need to tell the linker where the compiled Foundation code is, but I don't know how.
/tmp/ccL6nm6c.o(.text+0x28): undefined reference to `objc_get_class'
/tmp/ccL6nm6c.o(.text+0x28): relocation truncated to fit: R_PPC_REL24 objc_get_class
/tmp/ccL6nm6c.o(.text+0x3c): undefined reference to `objc_msg_lookup'
/tmp/ccL6nm6c.o(.text+0x3c): relocation truncated to fit: R_PPC_REL24 objc_msg_lookup
/tmp/ccL6nm6c.o(.text+0x64): undefined reference to `objc_msg_lookup'
/tmp/ccL6nm6c.o(.text+0x64): relocation truncated to fit: R_PPC_REL24 objc_msg_lookup
Steven
Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
probably -lobjc -lfoundation -lappkit or something... what are the libraries called and where are they installed?
Now it says this:
Steven
Quote:/usr/bin/ld: cannot find -lFoundationAnd I honestly don't know what to look for- what will it be named? I've been using locate to find stuff, but I need a file name.
Steven
Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
It'll be called something like libFoundation.so or libfoundation.so. At a wild guess, /usr/X11R6/lib/, /usr/GNUstep/Libraries/, /usr/X11R6/lib/GNUstep/ seem like reasonable places to try.
I tried doing
locate *foundation*.so
locate *Foundation*.so
locate *.so
and there was nothing like libfoundation.so.
However, I did find /usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so
I don't know if that's right though, or how to pass it to the linker. And, I don't have X11 installed, so those other paths don't exist.
Steven
locate *foundation*.so
locate *Foundation*.so
locate *.so
and there was nothing like libfoundation.so.
However, I did find /usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so
I don't know if that's right though, or how to pass it to the linker. And, I don't have X11 installed, so those other paths don't exist.
Steven
Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
I'm off to bed now, so I'll try anything that you say tomorrow morning... thanks OSC.
Steven
Steven
Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
Try adding this to your link arguments:
[font=monaco,courier]-L/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu -lgnustep-base[/font]
[font=monaco,courier]-L/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu -lgnustep-base[/font]
I added the above path to LIBRARY_PATH and now use this command to compile:
and it spits out ten thousand lines like this, including the stuff mentioned before:
Thanks,
Steven
Code:
gcc -lobjc -lgnustep-base Card.m CardStack.m main.m -o war
and it spits out ten thousand lines like this, including the stuff mentioned before:
Quote:/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `objc_lookup_class'
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `objc_get_type_qualifiers'
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `sel_types_match'
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `search_for_method_in_list'
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `dlerror'
Thanks,
Steven
Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
Please tell me that you have read this: Installation instructions
Granted it is complicated. There appear to be some support libraries needed. The instructions suggest that you need to compile the gnustep libraries. Did you do that, or do they have binaries? (I cannot find any binary downloads...)
There are other links to docs, but they don't work.
Granted it is complicated. There appear to be some support libraries needed. The instructions suggest that you need to compile the gnustep libraries. Did you do that, or do they have binaries? (I cannot find any binary downloads...)
There are other links to docs, but they don't work.

I did follow those instructions, except I didn't install the gui package as I don't have an X server installed on the computer. I compiled my own.
Steven
Steven
Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
Have you tried -lobjc and/or -ldl ?
Have you tried 'sudo apt-get install gnustep'?
Have you tried 'sudo apt-get install gnustep'?
I didn't think of using apt-get, I just reinstalled GNUstep from the package.
returns:
Thanks,
Steven
Quote:gcc -lobjc -lgnustep-base -ldl Card.m CardStack.m main.m -o war
returns:
Quote:/tmp/cc2IsoPM.o: In function `_i_Card__compare_':Could there be another library which defines all of these? What would it be called?
/tmp/cc2IsoPM.o(.text+0x84): undefined reference to `objc_msg_lookup'
/tmp/cc2IsoPM.o(.text+0x84): relocation truncated to fit: R_PPC_REL24 objc_msg_lookup
/tmp/cc2IsoPM.o(.text+0xb0): undefined reference to `objc_msg_lookup'
/tmp/cc2IsoPM.o(.text+0xb0): relocation truncated to fit: R_PPC_REL24 objc_msg_lookup
...
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `objc_lookup_class'
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `objc_get_type_qualifiers'
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `sel_types_match'
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `search_for_method_in_list'
Thanks,
Steven
Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
Possibly Related Threads...
Thread: | Author | Replies: | Views: | Last Post | |
Unholy method to link Linux library? | Cochrane | 3 | 4,479 |
Jun 30, 2008 06:37 AM Last Post: OptimisticMonkey |
|
Linux geek wanting to get into Mac games programming | supenguin | 8 | 7,296 |
Nov 16, 2005 09:49 PM Last Post: EvolPenguin |
|
porting linux glut code to mac os x | zynek | 12 | 9,804 |
Jan 23, 2005 05:47 PM Last Post: zynek |
|
Linux Games/Tibia | Kris | 3 | 5,884 |
Sep 27, 2004 04:08 PM Last Post: ERaZer |
|
Linux IDE's | wadesworld | 5 | 6,634 |
Jul 20, 2004 08:17 AM Last Post: Iron Wallaby |