Obj-C on Linux
Are there any other libs in the same place as libgnustep-base.so?
[font=monaco,courier]find /usr/lib -type f -name '*.so' | xargs nm | grep objc_lookup_class[/font] will at least tell you if any of the libraries in /usr/lib define objc_lookup_class. Probably also worth running a similar command on /usr/GNUstep/System/Libraries .
[font=monaco,courier]find /usr/lib -type f -name '*.so' | xargs nm | grep objc_lookup_class[/font] will at least tell you if any of the libraries in /usr/lib define objc_lookup_class. Probably also worth running a similar command on /usr/GNUstep/System/Libraries .
For /usr/lib, it prints a bunch of lines saying 'no symbols'
When I tried the second one, it printed a line saying
'nm: a.out: No such file or directory.'
So I then ran nm on libgnustep-base.so and piped it thru grep, and it returned this:
Now, trying again:
I'll try adding -ldl to the command line.
Thanks a bunch,
Steven
When I tried the second one, it printed a line saying
'nm: a.out: No such file or directory.'
So I then ran nm on libgnustep-base.so and piped it thru grep, and it returned this:
Quote: U objc_lookup_class
Now, trying again:
Quote:steven@hplmss1:~/war$ gcc -lgnustep-base -lobjc Card.m CardStack.m main.mLooks like I'm getting there.
Card.m:9:2: warning: #import is obsolete, use an #ifndef wrapper in the header file
CardStack.m:9:2: warning: #import is obsolete, use an #ifndef wrapper in the header file
main.m:1:2: warning: #import is obsolete, use an #ifndef wrapper in the header file
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `dlerror'
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `ceil'
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `floor'
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `dlclose'
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `rint'
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `dlopen'
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `pow'
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `dlsym'
collect2: ld returned 1 exit status
steven@hplmss1:~/war$
I'll try adding -ldl to the command line.
Quote:steven@hplmss1:~/war$ gcc -lgnustep-base -lobjc -ldl Card.m CardStack.m main.mGah! Down to four errors. Where would the above be?
Card.m:9:2: warning: #import is obsolete, use an #ifndef wrapper in the header file
CardStack.m:9:2: warning: #import is obsolete, use an #ifndef wrapper in the header file
main.m:1:2: warning: #import is obsolete, use an #ifndef wrapper in the header file
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `ceil'
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `floor'
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `rint'
/usr/GNUstep/System/Libraries/powerpc/linux-gnu/gnu-gnu-gnu/libgnustep-base.so: undefined reference to `pow'
collect2: ld returned 1 exit status
steven@hplmss1:~/war$
Thanks a bunch,
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?
-lm
WOOHOO!
It works! Now, can I have all of those -l parameters as the default or something? I don't want to have to write them over and over again.
Thanks a bunch OSC.
Steven
It works! Now, can I have all of those -l parameters as the default or something? I don't want to have to write them over and over again.
Thanks a bunch OSC.
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?
You only need them in the linking command, not in the commands to compile individual source files...
Yeah, but then anytime I want an updated executable, I have to do that :/
Any way to do it better?
Steven
Any way to do it better?
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?
Put it in a Makefile!
I haven't really used makefiles, and the size of my project doesn't seem to really warrant learning it. I've decided to alias it to something like occ.
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?
It's always worth having a makefile.
Really? Why?
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?
Because even when you've only got one source file, it's quicker to type make than it is to type gcc -g -c -Wall -W -Wno-unused-parameter -Werror -Os -I/usr/X11R6/include main.c; gcc -o Executable main.o -L/usr/X11R6/lib -lGL -lGLU -lglut -lX11 -lm, and when you've got more than one file keeping track of dependencies and what needs to be rebuilt makes such a huge improvement to compile times that it's pointless to avoid the makefile...
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Unholy method to link Linux library? | Cochrane | 3 | 2,788 |
Jun 30, 2008 06:37 AM Last Post: OptimisticMonkey |
|
| Linux geek wanting to get into Mac games programming | supenguin | 8 | 4,545 |
Nov 16, 2005 09:49 PM Last Post: EvolPenguin |
|
| porting linux glut code to mac os x | zynek | 12 | 5,725 |
Jan 23, 2005 05:47 PM Last Post: zynek |
|
| Linux Games/Tibia | Kris | 3 | 4,222 |
Sep 27, 2004 04:08 PM Last Post: ERaZer |
|
| Linux IDE's | wadesworld | 5 | 4,488 |
Jul 20, 2004 08:17 AM Last Post: Iron Wallaby |
|

