List Info

Thread: Re: GNUstep + Xcode




Re: GNUstep + Xcode
country flaguser name
United States
2008-04-25 22:47:05
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Markus Hitter <mahjump-ing.de> wrote:
>
> Am 22.04.2008 um 22:13 schrieb Joe Toscano:
>>
>> With respect to #3, I've encountered a rather
irritating problem: a
>> class defined in the netclasses framework (called
IRCObject, quite
>> clearly defined in IRCObject.h) is rejected by the
linker as "not
>> found". Yes, I have added the netclasses
framework to my Xcode
>> project.
>
> Does the linker find the framework? Have you
investigated the
> framework with nm / otool?

Yes, and yes. Here's the command output from Xcode:

Ld /Users/zhaytee/Projects/NSBang/Xcode/build/Debug/NSBang
normal i386
    cd /Users/zhaytee/Projects/NSBang/Xcode
    /Developer/usr/bin/gcc-4.0 -o
/Users/zhaytee/Projects/NSBang/Xcode/build/Debug/NSBang
-L/Users/zhaytee/Projects/NSBang/Xcode/build/Debug
-F/Users/zhaytee/Projects/NSBang/Xcode/build/Debug
-F/opt/local/GNUstep/Local/Library/Frameworks -filelist
/Users/zhaytee/Projects/NSBang/Xcode/build/NSBang.build/Debu
g/NSBang.build/Objects-normal/i386/NSBang.LinkFileList
-framework Foundation -framework netclasses -arch i386
Undefined symbols:
  ".objc_class_name_IRCObject", referenced from:
      .objc_class_name_NSBangIRCInterface in
NSBangIRCInterface.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

I would expect gcc/ld to complain loudly about the
non-presence of the
"netclasses" framework, if it were unable to find
same.


Here's an excerpt from the output of nm:

netclasses(single module):
00008ca4 t +[IRCObject initialize]
00000f28 t +[NSFramework_netclasses frameworkClasses]
00000efe t +[NSFramework_netclasses frameworkEnv]
00000f08 t +[NSFramework_netclasses frameworkPath]
...
00012fe0 S ___objc_class_name_IRCObject
...

So, clearly the IRCObject class is tucked away in there. Why
can't ld see it
when I compile my Xcode project, though? I'm rather stumped
on this one.

Thanks for your help,

~JT
http://virheroicus.com/ 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkgSpaYACgkQJSvLMGGefn8icgCg25/0iR/aPVudupEru/YG
j/6k
AtQAoJICPC7sQzMolOIb5qiFhC+PTmYv
=q4b+
-----END PGP SIGNATURE-----
_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustepgnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Re: GNUstep + Xcode
country flaguser name
Germany
2008-04-27 10:58:46
Joseph Toscano wrote:
> Ld
/Users/zhaytee/Projects/NSBang/Xcode/build/Debug/NSBang
normal i386
>     cd /Users/zhaytee/Projects/NSBang/Xcode
>     /Developer/usr/bin/gcc-4.0 -o
/Users/zhaytee/Projects/NSBang/ 
> Xcode/build/Debug/NSBang
-L/Users/zhaytee/Projects/NSBang/Xcode/ 
> build/Debug
-F/Users/zhaytee/Projects/NSBang/Xcode/build/Debug -F/ 
> opt/local/GNUstep/Local/Library/Frameworks -filelist
/Users/zhaytee/ 
>
Projects/NSBang/Xcode/build/NSBang.build/Debug/NSBang.build/
Objects- 
> normal/i386/NSBang.LinkFileList -framework Foundation
-framework  
> netclasses -arch i386
> Undefined symbols:
>   ".objc_class_name_IRCObject", referenced
from:
>       .objc_class_name_NSBangIRCInterface in
NSBangIRCInterface.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
>
> I would expect gcc/ld to complain loudly about the
non-presence of the
> "netclasses" framework, if it were unable to
find same.
>
>
> Here's an excerpt from the output of nm:
>
> netclasses(single module):
> 00008ca4 t +[IRCObject initialize]
> 00000f28 t +[NSFramework_netclasses frameworkClasses]
> 00000efe t +[NSFramework_netclasses frameworkEnv]
> 00000f08 t +[NSFramework_netclasses frameworkPath]
> ...
> 00012fe0 S ___objc_class_name_IRCObject
> ...
>
> So, clearly the IRCObject class is tucked away in
there. Why can't  
> ld see it
> when I compile my Xcode project, though? I'm rather
stumped on this  
> one.

Apparently, you are trying to link code which is compiled
for different
Objective-C runtimes, namely the Apple runtime (Foundation)
and the GNU
runtime (netclasses). You should either recompile netclasses
for the
Apple runtime (i.e., not with GNUstep) or set up Xcode such
that it
invokes the Objective-C compiler with -fgnu-runtime. You'll
also have to
set up include and link paths to GNUstep of course. And
don't forget to
pass -fconstant-string-class=NSConstantString to the
compiler.

Wolfgang




_______________________________________________
Discuss-gnustep mailing list
Discuss-gnustepgnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )