2013-04-03 94 views
0

我可以使用一些幫助解決以下在嘗試運行項目時遇到的錯誤。架構i386的未定義符號:「__products」,引用來自:

我的項目已經發布了In App Purchase。 在我的最新版本中,我嘗試將IAP集成到另一個視圖控制器中,但是當我想運行時,出現兩個Apple Mach-O鏈接器錯誤和一個Dsymutil錯誤。

自我上次發佈以來,我可能已經更新了Xcode(至版本4.6(4H127)),但我不確定。

有些事情我已經檢查:

  • 鏈接的二進制,二進制文件似乎仍包括所有neccessary框架;
  • 編譯源似乎包括我所有的.m文件;
  • 我找不到__products在我的代碼中的任何地方(_products我可以找到... ...:我做了一個全局變量的名稱(之前是一個局部變量))
  • 我試着在模擬器上運行,設備也是如此。

全局變量是在其被導入在視圖控制器其所需要h文件宣稱: 的extern的NSArray * _產品展示;

我不確定我的外部框架/庫會引起什麼麻煩。他們之前工作得很好:TestFlight,Appirater,CHCSVParser。

的錯誤:

Ld "/Users/jaspervandermaarel/Library/Developer/Xcode/DerivedData/Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky/Build/Products/Debug-iphonesimulator/Mijn Kinderen.app/Mijn Kinderen" normal i386 cd "/Users/jaspervandermaarel/Documents/Xcode projects/Mijn Kinderen" setenv IPHONEOS_DEPLOYMENT_TARGET 5.0 setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.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 i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.1.sdk -L/Users/jaspervandermaarel/Library/Developer/Xcode/DerivedData/Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky/Build/Products/Debug-iphonesimulator "-L/Users/jaspervandermaarel/Documents/Xcode projects/Mijn Kinderen/TestFlightSDK1-1" "-L/Users/jaspervandermaarel/Documents/Xcode projects/Mijn Kinderen" -F/Users/jaspervandermaarel/Library/Developer/Xcode/DerivedData/Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky/Build/Products/Debug-iphonesimulator -filelist "/Users/jaspervandermaarel/Library/Developer/Xcode/DerivedData/Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky/Build/Intermediates/Mijn Kinderen.build/Debug-iphonesimulator/Mijn Kinderen.build/Objects-normal/i386/Mijn Kinderen.LinkFileList" -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=5.0 -weak_framework Accounts -weak_framework Social -framework SystemConfiguration -framework CFNetwork -framework StoreKit -framework MessageUI -lz -framework UIKit -framework Foundation -framework CoreGraphics -framework CoreData -lTestFlight -o "/Users/jaspervandermaarel/Library/Developer/Xcode/DerivedData/Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky/Build/Products/Debug-iphonesimulator/Mijn Kinderen.app/Mijn Kinderen"

爲i386硬件架構未定義的符號: 「__products」,從引用: - [MKGebeurtenissenViewController voegToeGebeurtenis:]在MKGebeurtenissenViewController.o - [MKGebeurtenissenViewController alertView:clickedButtonAtIndex:]在MKGebeurtenissenViewController。 MKKinderenViewController.o中的[MKKinderenViewController productPurchased:] - [MKKinderenViewController voegKindToe:] MKKinder中的[MKKinderenViewController alertView:clickedButtonAtIndex:] enViewController.o - [MKGebeurtenissenViewController voegToeGebeurtenis:]在MKGebeurtenissenViewController.o - [MKGebeurtenissenViewController alertView:clickedButtonAtIndex:]在MKGebeurtenissenViewController.o - [MKKinderenViewController alertView:clickedButtonAtIndex:]在MKKinderenViewController.o - [MKKinderenViewController productPurchased:]在MKKinderenViewController。 ö - [MKKinderenViewController voegKindToe:]在MKKinderenViewController.o LD:符號(多個)未找到i386硬件架構 鐺:錯誤:連接器命令,退出代碼1失敗(使用-v看調用)

GenerateDSYMFile「 /用戶/ jaspervandermaarel /庫/開發商/ Xcode中/導出Data/Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky/Build/Products/Debug-iphonesimulator/Mijn Kinderen.app.dSYM「」/ Users/jaspervandermaarel/Library/Developer/Xcode/DerivedData/Mijn_Kinderen -dglsdifvjduysjbpixoiuyaekgky/Build/Products/Debug-iphonesimulator/Mijn Kinderen。 app/Mijn Kinderen「 cd」/ Users/jaspervandermaarel/Documents/Xcode projects/Mijn Kinderen「 setenv PATH」/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode中。應用/內容/開發人員的/ usr/bin中:在/ usr/bin中:/ bin中:/ usr/sbin目錄/ sbin目錄 「 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil」 /用戶/ jaspervandermaarel /庫/開發商/ Xcode中/ DerivedData/Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky /編譯/產品/調試iPhone模擬器/ Kinderen.app/Mijn我的孩子 「-o」/用戶/ jaspervandermaarel /庫/開發商/ Xcode中/ DerivedData/Mijn_Kinderen -dglsdifvjduysjbpixoiuyaekgky /編譯/產品/調試iPhone模擬器/我Kinderen.app.dSYM 「

錯誤:無法打開可執行文件」/用戶/ jaspervandermaarel /庫/開發商/ Xcode中/ DerivedData/Mijn_Kinderen-dglsdifvjduysjbpixoiuyaekgky /編譯/產品/調試iPhone模擬器/ Kinderen.app/Mijn我的孩子「

+0

您可以編輯您的問題,以顯示全局變量「'_products'」的聲明方式?希望它不只是一個「'extern'」。 – 2013-04-03 20:40:12

+0

恐怕就是,看到我的編輯。 這是壞? – user1492198 2013-04-03 20:46:26

回答

1

這不是塔T「extern」是壞的,你只需要聲明真正NSArray」在一些.m文件的某個地方,否則該對象並沒有真正分配腿部的任何地方的頂部。

所以,如果你申報你的「extern」變量在.h文件中,在.m文件的頂部支持該.h文件中聲明的真正變量。

E.G.

NSArray * _products; 

前的 「@implementation」 位。並確保你在.m文件做 &的alloc初始化該變量的地方。

+0

感謝;這擺脫了所有的三個錯誤的! 我宣佈它的@implementation位內。爲什麼多餘的下劃線添加到引起問題的符號? – user1492198 2013-04-04 04:52:33

相關問題