gpt4 book ai didi

iphone - 令人沮丧的 iPhone 构建错误

转载 作者:行者123 更新时间:2023-12-03 19:29:02 26 4
gpt4 key购买 nike

我已经为此奋斗了几个小时,我已经厌倦了。我的项目使用调试模拟器构建、发布模拟器构建和调试设备构建可以正常构建,但由于某种原因,它无法使用发布设备构建进行构建。我有一个包含我的 cocos2d 代码的静态库,以及另一个包含我编写的游戏引擎的静态库。

因为游戏引擎包含类别,所以我必须使用 all_load 链接器标志来让它运行。如果没有这个标志,代码就可以正常构建。但是,当我尝试运行游戏时,我收到发送到实例异常的无法识别的选择器。

这是第一个构建错误:

ld: duplicate symbol _OBJC_CLASS_$_FontLabel in /Users/helixed/Dropbox/Documents/Development/iPhone/Cocos2d/build/Release-iphoneos/libcocos2d.a(FontLabel.o) and /Users/helixed/Dropbox/Documents/Development/iPhone/Cocos2d/build/Release-iphoneos/libcocos2d.a(FontLabel.o)

Ld build/Shapeless.build/Release-iphoneos/Shapeless.build/Objects-normal/armv6/Shapeless normal armv6
cd /Users/helixed/Dropbox/Documents/Development/iPhone/Apps/Shapeless
setenv IPHONEOS_DEPLOYMENT_TARGET 4.0
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-g++-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk -L/Users/helixed/Dropbox/Documents/Development/iPhone/Apps/Shapeless/build/Release-iphoneos -F/Users/helixed/Dropbox/Documents/Development/iPhone/Apps/Shapeless/build/Release-iphoneos -filelist /Users/helixed/Dropbox/Documents/Development/iPhone/Apps/Shapeless/build/Shapeless.build/Release-iphoneos/Shapeless.build/Objects-normal/armv6/Shapeless.LinkFileList -dead_strip -ObjC -all_load -miphoneos-version-min=4.0 /Users/helixed/Dropbox/Documents/Development/iPhone/Cocos2d/build/Release-iphoneos/libChipmunk.a /Users/helixed/Dropbox/Documents/Development/iPhone/Cocos2d/build/Release-iphoneos/libcocos2d.a /Users/helixed/Dropbox/Documents/Development/iPhone/BlackHawk/build/Release-iphoneos/libBlackHawk.a -framework Foundation -framework UIKit -framework CoreGraphics -framework QuartzCore -framework OpenGLES -framework OpenAL -framework AVFoundation -framework AudioToolbox -lz -framework iAd -o /Users/helixed/Dropbox/Documents/Development/iPhone/Apps/Shapeless/build/Shapeless.build/Release-iphoneos/Shapeless.build/Objects-normal/armv6/Shapeless

ld: duplicate symbol _OBJC_CLASS_$_FontLabel in /Users/helixed/Dropbox/Documents/Development/iPhone/Cocos2d/build/Release-iphoneos/libcocos2d.a(FontLabel.o) and /Users/helixed/Dropbox/Documents/Development/iPhone/Cocos2d/build/Release-iphoneos/libcocos2d.a(FontLabel.o)
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-g++-4.2 failed with exit code 1

这是第二个:

Ld build/Shapeless.build/Release-iphoneos/Shapeless.build/Objects-normal/armv7/Shapeless normal armv7
cd /Users/helixed/Dropbox/Documents/Development/iPhone/Apps/Shapeless
setenv IPHONEOS_DEPLOYMENT_TARGET 4.0
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-g++-4.2 -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk -L/Users/helixed/Dropbox/Documents/Development/iPhone/Apps/Shapeless/build/Release-iphoneos -F/Users/helixed/Dropbox/Documents/Development/iPhone/Apps/Shapeless/build/Release-iphoneos -filelist /Users/helixed/Dropbox/Documents/Development/iPhone/Apps/Shapeless/build/Shapeless.build/Release-iphoneos/Shapeless.build/Objects-normal/armv7/Shapeless.LinkFileList -dead_strip -ObjC -all_load -miphoneos-version-min=4.0 /Users/helixed/Dropbox/Documents/Development/iPhone/Cocos2d/build/Release-iphoneos/libChipmunk.a /Users/helixed/Dropbox/Documents/Development/iPhone/Cocos2d/build/Release-iphoneos/libcocos2d.a /Users/helixed/Dropbox/Documents/Development/iPhone/BlackHawk/build/Release-iphoneos/libBlackHawk.a -framework Foundation -framework UIKit -framework CoreGraphics -framework QuartzCore -framework OpenGLES -framework OpenAL -framework AVFoundation -framework AudioToolbox -lz -framework iAd -o /Users/helixed/Dropbox/Documents/Development/iPhone/Apps/Shapeless/build/Shapeless.build/Release-iphoneos/Shapeless.build/Objects-normal/armv7/Shapeless

ld: duplicate symbol _OBJC_CLASS_$_FontLabel in /Users/helixed/Dropbox/Documents/Development/iPhone/Cocos2d/build/Release-iphoneos/libcocos2d.a(FontLabel.o) and /Users/helixed/Dropbox/Documents/Development/iPhone/Cocos2d/build/Release-iphoneos/libcocos2d.a(FontLabel.o)
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-g++-4.2 failed with exit code 1

这是阻止我发布的唯一想法,所以我非常感谢您的帮助。

谢谢。

最佳答案

我遇到了类似的问题,我不小心包含(#import)实现文件而不是头文件

当编译器抛出 2 个目标文件包含重复符号的错误时,请检查您如何在 2 个实现文件中包含(#import)该重复符号的类。

关于iphone - 令人沮丧的 iPhone 构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3570629/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com