Obj-C on Linux

Member
Posts: 370
Joined: 2002.04
Post: #1
This is probably a stupid question, and I don't expect much of a response other than 'No', but here goes...

Is it possible to use Objective C and the Foundation framework on a Debian Linux machine?
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?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Yes, for some definition of yes Smile

Check out GNUStep -- http://www.gnustep.org/
Quote this message in a reply
Member
Posts: 370
Joined: 2002.04
Post: #3
I've spent all afternoon downloading and fiddling- I'm now stuck where gcc can't compile (my other version was too old)
It's complaining that
Quote:checking whether the C compiler (gcc -g -O2) works... no
configure: error: installation or configuration problem: C compiler cannon create executables

How do I fix this?
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?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
Does gcc work?
Quote this message in a reply
Member
Posts: 370
Joined: 2002.04
Post: #5
Blush
No, it doesn't. I don't have the standard includes- like stdio.h
I have no clue why, as gcc is installed. How can I install them?
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?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #6
Looks like you need the libc6-dev package on Debian. You may be able to use 'sudo apt-get install libc6-dev'.
Quote this message in a reply
Member
Posts: 370
Joined: 2002.04
Post: #7
Thanks, I'll do that when I get home from school...
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?
Quote this message in a reply
Member
Posts: 370
Joined: 2002.04
Post: #8
It seems to work now, it's been compiling for something like the last hour...
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?
Quote this message in a reply
Member
Posts: 370
Joined: 2002.04
Post: #9
Still compiling... wow, GCC is HUGE!!! I haven't even started on GNUStep yet... almost three hours now.
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?
Quote this message in a reply
Member
Posts: 370
Joined: 2002.04
Post: #10
Still compiling GCC, almost 24 hours now...
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?
Quote this message in a reply
Member
Posts: 370
Joined: 2002.04
Post: #11
I installed gcc, then compiled and installed gnustep-base-1.5.0 and gnustep-make-1.5.0
I then followed the instructions and tried to do a
Quote:defaults write NSGlobalDomain NSLanguages "English"
and it said
Quote:defaults: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory
I can't figure out why this would happen.
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?
Quote this message in a reply
Member
Posts: 370
Joined: 2002.04
Post: #12
I managed to fix it by reinstalling it. More later on how it works.
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?
Quote this message in a reply
Member
Posts: 370
Joined: 2002.04
Post: #13
Ok, everything seems to be working now. Only problem is that it can't find Foundation.h.
Quote:steven@hplmss1:~/war$ gcc main.m
main.m:1:2: warning: #import is obsolete, use an #ifndef wrapper in the header file
main.m:1:34: Foundation/Foundation.h: No such file or directory
In file included from main.m:2:
CardStack.h:9:34: Foundation/Foundation.h: No such file or directory
In file included from CardStack.h:10,
from main.m:2:
Card.h:9:34: Foundation/Foundation.h: No such file or directory
In file included from CardStack.h:10,
from main.m:2:
Card.h:14: cannot find interface declaration for `NSObject', superclass of `Card'
How do I include the Foundation framework? Also, is it safe to assume that #import will be ok to use, or must I really change it?
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?
Quote this message in a reply
Member
Posts: 370
Joined: 2002.04
Post: #14
Oh, and one more thing: can I use frameworks like MOKit.framework? If so, how? 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?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #15
Looks like you need to include <Foundation/NSObject.h>, <Foundation/NSString.h>, &c.

You shouldn't use #import with GNUStep. All the include stuff is going to be different on the two platforms, you'll just have to #ifndef it.

External frameworks & libraries will probably need a bit of porting (changing includes, &c). Some will already have been ported.

Google is your friend.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Unholy method to link Linux library? Cochrane 3 3,182 Jun 30, 2008 06:37 AM
Last Post: OptimisticMonkey
  Linux geek wanting to get into Mac games programming supenguin 8 5,166 Nov 16, 2005 09:49 PM
Last Post: EvolPenguin
  porting linux glut code to mac os x zynek 12 6,461 Jan 23, 2005 05:47 PM
Last Post: zynek
  Linux Games/Tibia Kris 3 4,551 Sep 27, 2004 04:08 PM
Last Post: ERaZer
  Linux IDE's wadesworld 5 4,915 Jul 20, 2004 08:17 AM
Last Post: Iron Wallaby