XcodeGCC链接问题:文件不是必需的体系结构

XcodeGCC链接问题:文件不是必需的体系结构,第1张

概述我正在尝试将包含boost 1.37和wxwidgets的 Windows项目移植到Mac.它编译好了,但链接器给了我一个“文件不是架构ppc所需的架构”错误的libz.1.dylib和相同的消息作为警告其他一些库.我还得到了libz.1.dylib的“重复dylib”警告. 链接器输出如下所示: 使用配置“Debug”构建项目“Gemsweeper Mac”的目标“Gemsweeper Mac” 我正在尝试将包含boost 1.37和wxWidgets的 Windows项目移植到Mac.它编译好了,但链接器给了我一个“文件不是架构ppc所需的架构”错误的libz.1.dylib和相同的消息作为警告其他一些库.我还得到了libz.1.dylib的“重复dylib”警告.

链接器输出如下所示:

使用配置“DeBUG”构建项目“Gemsweeper Mac”的目标“Gemsweeper Mac”

检查依赖关系

Ld "/Users/adriangrigore/documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/DeBUG/Gemsweeper Mac.app/Contents/MacOS/Gemsweeper Mac" normal i386    cd "/Users/adriangrigore/documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac"    setenv MACOSX_DEPLOYMENT_TARGET 10.4    /Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk "-L/Users/adriangrigore/documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/DeBUG" -L/Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib -L/opt/local/lib "-F/Users/adriangrigore/documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/DeBUG" -F/Users/adriangrigore/library/Frameworks -F/Developer/SDKs/MacOSX10.4u.sdk/library/Frameworks -fileList "/Users/adriangrigore/documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/Gemsweeper Mac.build/DeBUG/Gemsweeper Mac.build/Objects-normal/i386/Gemsweeper Mac.linkfileList" -mmacosx-version-min=10.4 -L/opt/local/lib -L/Users/adriangrigore/wxWidgets-manual/wxMac-2.8.9/lib /opt/local/lib/libboost_system-mt.a /opt/local/lib/libboost_program_options-mt.a /opt/local/lib/libboost_thread-mt.a -arch ppc -arch i386 -framework IOKit -framework Carbon -framework Cocoa -framework System -framework QuickTime -framework OpenGL -framework AGL /Users/adriangrigore/wxWidgets-manual/wxMac-2.8.9/lib/libwx_mac-2.8.a -framework WebKit -lwxexpat-2.8 -lwxtiff-2.8 -lwxjpeg-2.8 -lwxpng-2.8 -lz -lpthread -liconv -framework SDL -framework Cocoa -o "/Users/adriangrigore/documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/DeBUG/Gemsweeper Mac.app/Contents/MacOS/Gemsweeper Mac"ld warning: in /Users/adriangrigore/documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/Gemsweeper Mac.build/DeBUG/Gemsweeper Mac.build/Objects-normal/i386/main.o,file is not of required architectureld warning: in /Users/adriangrigore/documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/Gemsweeper Mac.build/DeBUG/Gemsweeper Mac.build/Objects-normal/i386/varIoUsfunctions-xcode.o,file is not of required architectureld warning: in /Users/adriangrigore/documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/Gemsweeper Mac.build/DeBUG/Gemsweeper Mac.build/Objects-normal/i386/ParticleLayers.o,file is not of required architectureld warning: in /Users/adriangrigore/documents/Gemsweeper Mac/Gemsweeper MacOS/Gemsweeper Mac/build/Gemsweeper Mac.build/DeBUG/Gemsweeper Mac.build/Objects-normal/i386/SDLMain.o,file is not of required architectureld warning: in /opt/local/lib/libboost_system-mt.a,file is not of required architectureld warning: in /opt/local/lib/libboost_program_options-mt.a,file is not of required architectureld warning: in /opt/local/lib/libboost_thread-mt.a,file is not of required architectureld warning: in /opt/local/lib/libz.dylib,file is not of required architectureld warning: in /opt/local/lib/libiconv.dylib,file is not of required architectureld: in /opt/local/lib/libz.1.dylib,file is not of required architecture for architecture ppccollect2: ld returned 1 exit statusld warning: duplicate dylib /opt/local/lib/libz.1.dylibld warning: duplicate dylib /opt/local/lib/libiconv.2.dylib

我对Mac平台很新,所以任何帮助都将不胜感激!

谢谢,

阿德里安

解决方法 从您收到的消息中,大多数Gemsweeper Mac和libboost都只使用ppc作为架构进行编译.您应该配置Xcode以生成通用二进制文件,并可能通过MacPorts重新编译libboost.最近的MacPorts有一个“通用”目标可以帮助,虽然如果你不打算在ppc上运行它,你只需重新编译它.

您似乎也需要重新编译zlib和libiconv.

总结

以上是内存溢出为你收集整理的Xcode / GCC链接问题:文件不是必需的体系结构全部内容,希望文章能够帮你解决Xcode / GCC链接问题:文件不是必需的体系结构所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1103921.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-28
下一篇 2022-05-28

发表评论

登录后才能评论

评论列表(0条)

保存