与 Cocotron 的链接错误
我最近为 Cocotron 构建了一个 Linux 平台接口,并且能够构建没有错误的 Foundation 框架。
但是,当链接我的 Objective-C 项目时,我收到链接器错误:
/Developer/Cocotron/1.0/Linux/i386/Frameworks/Foundation.framework//libFoundation.so: undefined reference to `__gnu_objc_personality_v0'
我做了一点谷歌搜索,但没有发现任何有用的东西。
这是我的 ld 命令行(为了便于阅读而进行了一些简化):
Ld /Users/me/MyProject/build/Linux/Release/ENCLAnalyzer normal i386
cd /Users/me/MyProject
/Developer/Cocotron/1.0/Linux/i386/gcc-4.3.1/bin/i386-ubuntu-linux-gcc -arch i386
-L/Users/me/MyProject/build/Linux/Release
-L../../frameworks/Shared/FFmpeg/Linux/lib
-L/Developer/Cocotron/1.0/PlatformInterfaces/i386-ubuntu-linux/lib
-L/Developer/Cocotron/1.0/PlatformInterfaces/i386-ubuntu-linux/intel/mkl/9.0/lib/32
-L/Developer/Cocotron/1.0/PlatformInterfaces/i386-ubuntu-linux/intel/ipp/5.1/ia32/sharedlib
-L/Users/me/frameworks/Shared/FFmpeg/Linux/lib
-F/Users/me/MyProject/build/Linux/Release
-F/Users/me/frameworks/Shared
-F/Developer/Cocotron/1.0/Linux/i386/Frameworks
-F/Users/me/frameworks/OtherProject/Linux
-filelist "/Users/me/MyProject/build/Linux/MyProject.build/Release/MyProject Linux.build/Objects-normal/i386/MyProject.LinkFileList"
-Wl,-rpath-link,/Developer/Cocotron/1.0/PlatformInterfaces/i386-ubuntu-linux/lib
-Wl,-rpath-link,../../frameworks/Shared/FFmpeg/Linux/lib
-Wl,-rpath-link,/Developer/Cocotron/1.0/PlatformInterfaces/i386-ubuntu-linux/intel/ipp/5.1/ia32/sharedlib
-Wl,-rpath-link,/Developer/Cocotron/1.0/PlatformInterfaces/i386-ubuntu-linux/intel/mkl/9.0/lib/32
-Wl,-rpath-link,/Developer/Cocotron/1.0/Linux/i386/Frameworks/Foundation.framework
-framework Foundation -framework MyFramework1 -framework MyFramework2 -framework MyFramework3
-o /Users/me/MyProject/build/Linux/Release/MyProject
我有一种感觉,基础项目需要链接到一个它不是的库,或者它可能链接到某个库的错误版本。 但我不确定。
任何帮助将非常感激。
I've recently built a linux platform interface for Cocotron, and was able to build the Foundation framework with no errors.
However, when linking my objective-C project, I get a linker error:
/Developer/Cocotron/1.0/Linux/i386/Frameworks/Foundation.framework//libFoundation.so: undefined reference to `__gnu_objc_personality_v0'
I've done a bit of googling, but haven't found anything all that helpful.
Here's my ld command line (simplified a bit for readability):
Ld /Users/me/MyProject/build/Linux/Release/ENCLAnalyzer normal i386
cd /Users/me/MyProject
/Developer/Cocotron/1.0/Linux/i386/gcc-4.3.1/bin/i386-ubuntu-linux-gcc -arch i386
-L/Users/me/MyProject/build/Linux/Release
-L../../frameworks/Shared/FFmpeg/Linux/lib
-L/Developer/Cocotron/1.0/PlatformInterfaces/i386-ubuntu-linux/lib
-L/Developer/Cocotron/1.0/PlatformInterfaces/i386-ubuntu-linux/intel/mkl/9.0/lib/32
-L/Developer/Cocotron/1.0/PlatformInterfaces/i386-ubuntu-linux/intel/ipp/5.1/ia32/sharedlib
-L/Users/me/frameworks/Shared/FFmpeg/Linux/lib
-F/Users/me/MyProject/build/Linux/Release
-F/Users/me/frameworks/Shared
-F/Developer/Cocotron/1.0/Linux/i386/Frameworks
-F/Users/me/frameworks/OtherProject/Linux
-filelist "/Users/me/MyProject/build/Linux/MyProject.build/Release/MyProject Linux.build/Objects-normal/i386/MyProject.LinkFileList"
-Wl,-rpath-link,/Developer/Cocotron/1.0/PlatformInterfaces/i386-ubuntu-linux/lib
-Wl,-rpath-link,../../frameworks/Shared/FFmpeg/Linux/lib
-Wl,-rpath-link,/Developer/Cocotron/1.0/PlatformInterfaces/i386-ubuntu-linux/intel/ipp/5.1/ia32/sharedlib
-Wl,-rpath-link,/Developer/Cocotron/1.0/PlatformInterfaces/i386-ubuntu-linux/intel/mkl/9.0/lib/32
-Wl,-rpath-link,/Developer/Cocotron/1.0/Linux/i386/Frameworks/Foundation.framework
-framework Foundation -framework MyFramework1 -framework MyFramework2 -framework MyFramework3
-o /Users/me/MyProject/build/Linux/Release/MyProject
I have a feeling that the foundation project needs to link to a library that it isn't, or that maybe it is linking to the wrong version of some library. But I'm not sure.
Any help would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您使用哪个编译器? 我希望是 Cococtron 的那个? 请查看此讨论。
当您指定不正确的编译器(例如,对于没有 -x 选项的 C++ 代码的 gcc)时,会出现 __gnu_objc_personality_v0 。 尝试设置一些开关来告诉 g++ 您要编译 Obj-C 代码。
Which compiler are you using? The one from Cococtron, I hope? Take a look at this discussion.
The
__gnu_objc_personality_v0
occurs when you specify the incorrect compiler (say gcc for C++ code without the -x option). Try setting up some switches to tell g++ that you want to compile Obj-C code.更新:Cocotron 存储库中有一些编译器更新修复了
这个问题。 安装脚本已更新以获取这些和新的
版本在这里:
http://cocotron.org/Tools/Downloads/ InstallCDT-2009-04-17.zip
使用此之前,请务必删除
/Developer/Cocotron/1.0/Downloads/gcc-4.3.1.tar.bz2 否则它不会选择
上新的来源。 确保重新安装时指定 Linux i386。
即
sudo ./install.sh Linux i386
感谢 Christopher Lloyd 提供上述信息,并通过电子邮件向我发送修复程序。
Update: There were some compiler updates in the Cocotron repository which fix
this issue. The the install script has been updated to pick these up and the new
version is here:
http://cocotron.org/Tools/Downloads/InstallCDT-2009-04-17.zip
Before using this, be sure to delete
/Developer/Cocotron/1.0/Downloads/gcc-4.3.1.tar.bz2 or it won't pick
up the new source. Make sure to specify Linux i386 when reinstalling.
i.e.
sudo ./install.sh Linux i386
Thanks to Christopher Lloyd for the info above, and for emailing me the fix.