I don't believe that gcc comes with much in the way of libraries other than
just the runtime. You'll probably need to install the libfoundation
development kit. (libfoundation-dev in Debian; that'll pull in the compiler
too. You are aware that pretty much every distro comes with a prebuilt
Objective C compiler, right? You don't need to rebuild gcc if you don't want to.)
libfoundation gives you an OpenStep implementation:
http://www.gnustep.org/resources/documentation/Developer/Base/Reference/Base.html
There appears to be some networking classes in there.
--
┌── dg@cowlark.com ─── http://www.cowlark.com ───────────────────
│
│ "May you be blessed by His Noodly Appendage!"
│
> libfoundation gives you an OpenStep implementation:
>
> http://www.gnustep.org/resources/documentation/Developer/Base/Reference/Base.html
>
> There appears to be some networking classes in there.
>
Thanks, much appreciated.
Usually a Linux distro will have a package called gcc-objc or something
similar, which contains the Objective-C support for gcc. gcc is *the*
Objective-C compiler, so no other has any benefits over it ;-)
>> libfoundation gives you an OpenStep implementation:
>>
>> http://www.gnustep.org/resources/documentation/Developer/Base/Reference/Base.html
>>
>> There appears to be some networking classes in there.
>>
> Thanks, much appreciated.
Yup, gnustep-base or libfoundation are pretty good places to start (I'd
recommend gnustep-base, as it has more users and is very stable and
mature, but I'm also a gnustep maintainer so I may be biased). Once
you've got one of those installed, take a look at netclasses
http://netclasses.aeruder.net which is a very convenient way of setting
up asynchronous network connections ;-)
--
Graham Lee
http://www.thaesofereode.info
Debian provides gobjc and gobjc++ packages, which pull in ObjC and ObjC++ via
gcc (default version is 4.1.1 on my system, but you can pick and choose).
However, if you install any ObjC development package (such as
libgnustep-base-dev), it'll automatically install gobjc for you.
[...]
> Yup, gnustep-base or libfoundation are pretty good places to start (I'd
> recommend gnustep-base, as it has more users and is very stable and
> mature, but I'm also a gnustep maintainer so I may be biased).
That's what I get for not following through on the documentation --- I thought
GNUstep *used* libfoundation...
:-) There are multiple libFoundation projects, of which two I think are
active...there's one which was started by OpenDarwin and AFAIK has
little implementation of the Foundation library yet. The other is a
fork of gnustep-base which was developed by Skyrix and is part of
OpenGroupware.org.
> Thanks for all the replies. I think I have a distro problem
> though. I'm running on Gentoo (please, let it go) and they do have
> packages available for GNUStep, and I've installed them, but I think
> the installer neglects to set the lib and header paths. I can find the
> headers on the filesystem at /usr/GNUstep/.../Headers. It looks
> complete, but gcc can't find them. I've already dropped a line on the
> Gentoo forums, but I've heard nothing back.
Have you sourced the required startup scripts in your shell environment?
Mentioned here, at the bottom of the page:
<http://www.gnustep.org/resources/documentation/Developer/Base/ProgrammingManual/manual_1.html#SEC11>
AKA <http://tinyurl.com/26zgdp>
sherm--
--
Web Hosting by West Virginians, for West Virginians: http://wv-www.net
Cocoa programming in Perl: http://camelbones.sourceforge.net
but linking fails with this error:
Making all for tool test...
Linking tool test ...
/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../crt1.o: In function `_start':
init.c:(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
make[1]: *** [shared_obj/test] Error 1
make: *** [test.all.tool.variables] Error 2
> I'm trying to compile the
> simple program here:
> http://www.gnustep.org/resources/documentation/Developer/Base/ProgrammingManual/manual_1.html#SEC11
>
> but linking fails with this error:
>
> Making all for tool test...
> Linking tool test ...
> /usr/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../crt1.o: In function `_start':
> init.c:(.text+0x18): undefined reference to `main'
Well, the meaning of the error is pretty obvious - the linker isn't finding
the main() function that's at the bottom of the example.
As to why that may be, I'd look for typos - maybe you misnamed the function
or something like that. It can't be something *too* horrible, else you would
have gotten a compiler error instead of a linker error.
If you can't find the typo, post your code - copy & paste it, don't try to
retype it. As the saying goes, with enough eyes all bugs are shallow.
The former OpenDarwin branch (now known as "Substrate") is a fork of the
original libFoundation, which is not (and to my knowledge, never has been) a
fork of the GNUstep Base library. The original libFoundation was written by
Helge Hess, Mircea Oancea, and Ovidiu Predescu, and I don't know if it even
contains GNUstep code.