2

oday 我尝试在 Xcode 5.1 中编译我的示例应用程序,但出现链接器错误,有人可以告诉我为什么会这样吗?

Ld /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Intermediates/Slot321.build/Debug-iphoneos/Slot321\ iOS.build/Objects-normal/arm64/Slot321\ iOS normal arm64
    cd /Users/mmmssss/Documents/xcode5_projects/Slot321/Slot321/proj.ios_mac
    export IPHONEOS_DEPLOYMENT_TARGET=5.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk -L/Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Products/Debug-iphoneos -F/Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Products/Debug-iphoneos -filelist /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Intermediates/Slot321.build/Debug-iphoneos/Slot321\ iOS.build/Objects-normal/arm64/Slot321\ iOS.LinkFileList -dead_strip -stdlib=libc++ -fobjc-link-runtime -miphoneos-version-min=5.0 /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Products/Debug-iphoneos/libbox2d\ iOS.a /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Products/Debug-iphoneos/libchipmunk\ iOS.a /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Products/Debug-iphoneos/libcocos2dx\ iOS.a /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Products/Debug-iphoneos/libcocos2dx-extensions\ iOS.a /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Products/Debug-iphoneos/libCocosDenshion\ iOS.a -framework CoreMotion -framework Foundation -framework UIKit -framework CoreGraphics -framework OpenGLES -lz -framework QuartzCore -framework OpenAL -framework AVFoundation -framework AudioToolbox -Xlinker -dependency_info -Xlinker /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Intermediates/Slot321.build/Debug-iphoneos/Slot321\ iOS.build/Objects-normal/arm64/Slot321\ iOS_dependency_info.dat -o /Users/mmmssss/Library/Developer/Xcode/DerivedData/Slot321-ggaqzqgvjcazkuaqnngfqbbcfvvw/Build/Intermediates/Slot321.build/Debug-iphoneos/Slot321\ iOS.build/Objects-normal/arm64/Slot321\ iOS

Undefined symbols for architecture arm64:
  "_WebPGetFeaturesInternal", referenced from:
      WebPGetFeatures(unsigned char const*, unsigned long, WebPBitstreamFeatures*) in libcocos2dx iOS.a(CCImage.o)
  "_WebPDecode", referenced from:
      cocos2d::Image::initWithWebpData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_TIFFGetField", referenced from:
      cocos2d::Image::initWithTiffData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_TIFFClose", referenced from:
      cocos2d::Image::initWithTiffData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_jpeg_CreateDecompress", referenced from:
      cocos2d::Image::initWithJpgData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_jpeg_read_header", referenced from:
      cocos2d::Image::initWithJpgData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_TIFFReadRGBAImageOriented", referenced from:
      cocos2d::Image::initWithTiffData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_jpeg_start_decompress", referenced from:
      cocos2d::Image::initWithJpgData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_jpeg_read_scanlines", referenced from:
      cocos2d::Image::initWithJpgData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_jpeg_destroy_decompress", referenced from:
      cocos2d::Image::initWithJpgData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_WebPInitDecoderConfigInternal", referenced from:
      WebPInitDecoderConfig(WebPDecoderConfig*) in libcocos2dx iOS.a(CCImage.o)
  "_png_create_info_struct", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_read_info", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_jpeg_std_error", referenced from:
      cocos2d::Image::initWithJpgData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_get_image_width", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_set_packing", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_create_read_struct", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_get_image_height", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_set_palette_to_rgb", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_sig_cmp", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_get_valid", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_read_end", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_set_longjmp_fn", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "__TIFFfree", referenced from:
      cocos2d::Image::initWithTiffData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_FT_Done_FreeType", referenced from:
      cocos2d::FontFreeType::shutdownFreeType() in libcocos2dx iOS.a(CCFontFreeType.o)
  "_png_set_tRNS_to_alpha", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_get_rowbytes", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_read_update_info", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_jpeg_mem_src", referenced from:
      cocos2d::Image::initWithJpgData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_set_expand_gray_1_2_4_to_8", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "__TIFFmalloc", referenced from:
      cocos2d::Image::initWithTiffData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_set_strip_16", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_get_io_ptr", referenced from:
      cocos2d::(anonymous namespace)::pngReadCallback(png_struct_def*, unsigned char*, unsigned long) in libcocos2dx iOS.a(CCImage.o)
  "_png_set_read_fn", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_error", referenced from:
      cocos2d::(anonymous namespace)::pngReadCallback(png_struct_def*, unsigned char*, unsigned long) in libcocos2dx iOS.a(CCImage.o)
  "_png_get_bit_depth", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_get_color_type", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_destroy_read_struct", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_TIFFClientOpen", referenced from:
      cocos2d::Image::initWithTiffData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
  "_png_read_image", referenced from:
      cocos2d::Image::initWithPngData(unsigned char const*, long) in libcocos2dx iOS.a(CCImage.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
4

4 回答 4

4

cocos2d-x 的最新版本(Cocos2d-x v3.0 rc0)修复了这个问题。新版本增加了对 XCode 5.1 的 arm64 支持。

您应该升级您的项目,从这里下载新版本。

更多信息可以在官方更新日志中找到。

于 2014-03-17T01:24:18.523 回答
3

转到您的项目设置、构建设置、架构,然后选择“其他...”。修改字符串为 read $(ARCHS_STANDARD_32_BIT)

于 2014-03-14T20:21:09.307 回答
0

那些外部库也被编译了arm64吗?因为如果没有,那么您必须在 Xcode 设置中禁用它,例如制作它{ARCHS_STANDARD_32BIT}

于 2014-03-13T20:59:37.377 回答
-1

更改您的库版本。

就我而言,我为 iOS 7.1 版本更改了 UIKit.framework、CoreMotion.framework 和 OpenGLES.framework 库。(在构建阶段 > LinkBinary 与库)

删除红色库并添加它的新版本。

于 2014-03-14T02:17:29.107 回答