In article <391bb2b1.0409151807.69a21a5@posting.google.com>,
Steve <Rice421@hotmail.com> wrote:
I have successfully installed GNUstep on linux (Redhat 9) and am
trying to compile (using GCC) a simple test program (Fraction.m from
the tutorial at
http://www.otierney.net/objective-c.html), however, I
am getting the error "undefined reference to
'__objc_class_name_NSObject'".
I used the compile command:
gcc -o Fraction -I/usr/GNUstep/System/Library/Headers
-L/usr/GNUstep/System/Library/Libraries
Fraction.m
-ldl
-lobjc
If anyone has any clues about this, I would be very grateful.
On your command line, you're specifying to link with the 'dl' library
(for dynamic loading I expect), and the 'objc' library, which contains
the GNU Objective-C runtime system. Neither one of those, however,
contains the NSObject class: That's in the GNUStep base library, which
you also will need to specify on the command line. You've already told the
linker where to look for the library
(-L/usr/GNUstep/System/Library/Libraries), now you just need to tell it
which one of those libraries is should link against :)
Cheers,
Best wishes,
Steve.
// Christian Brunschen