discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Symbols not found?


From: Kevin Ingwersen
Subject: Re: Symbols not found?
Date: Fri, 13 Dec 2013 01:55:28 +0100

Hey.

OK; i got the thing with Foundation sorted - I realized I could just use Object 
instead of NSObject.
But now, I have a problem. x.x

Using -fgnu-runtime will make the whole thing fall back to using headers from:
        
/opt/GNUstep/lib/gcc/x86_64-apple-darwin13.0.0/4.8.2/include-gnu-runtime/objc/

Problem is, that the Object declared here has basically nothing, and of course, 
won’t fit with the libobjc that I compiled, which very obviously has that.

So, I figured that using -fgnu-runtime will automaticaly link against objc-gnu, 
and I cant even prevent it. Reading a bit further into the source, I found the 
__OBJC2__ macro within objc/Object.h:38 from gnustep’s libobjc. After reading 
thru GCC’s help some more, I found -fobjc-std=objc1…which very obviously didnt 
bother to undefine __OBJC2__ in order to unveal the Object interface declared 
in the header. duh.

Next attempt was to specify the dynamic library itself as a command line 
argument - that also didnt work. So I combined it with -U__OBJC2__. That did 
some obvious effect. However, that also showed me, that it was still trying to 
link to libobjc in a manner thats probably not conform.

Ingwie@Ingwies-Air ~/Work/objc $ /opt/GNUstep/bin/gcc test4.m 
/opt/GNUstep/lib/libobjc.dylib -U__OBJC2__ -fnext-runtime
Undefined symbols for architecture x86_64:
  "__objc_empty_cache", referenced from:
      _OBJC_METACLASS_$_Greeter in ccVArV3W.o
      _OBJC_CLASS_$_Greeter in ccVArV3W.o
  "__objc_empty_vtable", referenced from:
      _OBJC_METACLASS_$_Greeter in ccVArV3W.o
      _OBJC_CLASS_$_Greeter in ccVArV3W.o
  "_objc_msgSend_fixup", referenced from:
      anon in ccVArV3W.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status

So, how do I tell GCC now to in fact use the linking style of objc-gnu, which 
appearently is objc1, but instead use the default headers instead of the 
special headers from the path i named above?

If that will not work, Im just going to install clang into that bundle and see 
if that would work better. x.x

Regards Ingwie
PS: I am sure, that if i get over these stupid things, I am pretty much done 
with a proper Gnustep for mac build. ^^


Am 12.12.2013 um 22:11 schrieb Wolfgang Lux <wolfgang.lux@gmail.com>:

> Kevin Ingwersen <ingwie2000@googlemail.com> wrote:
> 
>> I couldnt sit still, and instead searched further. I ended up with the fact 
>> that I forgot to link the foundation framework, and managed to link in the 
>> libobjc I created. Now however, I have the problem that I am linked to 2 
>> libobjc’s - the one from apple and the one from GNUstep. So how do I prevent 
>> GCC from auto-linking against Apple’s runtime?
> 
> I'm not sure what you are trying to achieve here, but the only way to avoid 
> linking against Apple's runtime is to not link against any of Apple's 
> frameworks (including, but not limited to CoreFoundation, Foundation and 
> AppKit). These files have been linked against Apple's ObjC runtime by Apple 
> when the system was built and there's no way to undo that.
> 
> Wolfgang
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]