Xcode 5.1中的链接器错误与cocos2d-x 3 beta 2

时间:2014-03-13 20:55:25

标签: c++ xcode5 cocos2d-x cocos2d-x-3.0

今天我尝试在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 个答案:

答案 0 :(得分:4)

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

您应升级项目,从here下载新版本。

更多信息可在官方changelog找到。

答案 1 :(得分:3)

转到项目设置,构建设置,体系结构,然后选择“其他......”。修改字符串以阅读$(ARCHS_STANDARD_32_BIT)

答案 2 :(得分:0)

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

答案 3 :(得分:-1)

更改您的库版本。

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

删除红色图书库并添加新版本。