2013-10-04 43 views
1

我使用CocoaPods將tumblr sdk安裝到c4項目中。不添加任何代碼到c4workspace我得到以下錯誤:在C4中使用Tumblr SDK - (鏈接器錯誤,重複的符號)

我檢查了另一個問題,誰回答的人說,這是事做有兩個

Ld /Users/me/Library/Developer/Xcode/DerivedData/test1-ccqtiznytmfywgdvbkcvvdlombrb/Build/Products/Debug-iphonesimulator/test1.app/test1 normal i386 
    cd /Users/me/Documents/TradeCity/test1 
    setenv IPHONEOS_DEPLOYMENT_TARGET 6.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.0.sdk -L/Users/me/Library/Developer/Xcode/DerivedData/test1-ccqtiznytmfywgdvbkcvvdlombrb/Build/Products/Debug-iphonesimulator -L/Users/me/Documents/TradeCity/test1/test1/Library -F/Users/me/Library/Developer/Xcode/DerivedData/test1-ccqtiznytmfywgdvbkcvvdlombrb/Build/Products/Debug-iphonesimulator -filelist /Users/me/Library/Developer/Xcode/DerivedData/test1-ccqtiznytmfywgdvbkcvvdlombrb/Build/Intermediates/test1.build/Debug-iphonesimulator/test1.build/Objects-normal/i386/test1.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -framework Foundation -weak_framework UIKit -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.0 -framework Accelerate -framework AVFoundation -framework CoreFoundation -framework CoreGraphics -framework CoreImage -framework CoreMedia -framework CoreText -framework Foundation -framework OpenGLES -framework QuartzCore -framework UIKit -lC4 -lPods -o /Users/me/Library/Developer/Xcode/DerivedData/test1-ccqtiznytmfywgdvbkcvvdlombrb/Build/Products/Debug-iphonesimulator/test1.app/test1 

duplicate symbol _OBJC_METACLASS_$_C4WorkSpace in: 
    /Users/me/Library/Developer/Xcode/DerivedData/test1-ccqtiznytmfywgdvbkcvvdlombrb/Build/Intermediates/test1.build/Debug-iphonesimulator/test1.build/Objects-normal/i386/C4WorkSpace.o 
    /Users/me/Documents/TradeCity/test1/test1/Library/libC4.a(C4WorkSpace.o) 
duplicate symbol _OBJC_CLASS_$_C4WorkSpace in: 
    /Users/me/Library/Developer/Xcode/DerivedData/test1-ccqtiznytmfywgdvbkcvvdlombrb/Build/Intermediates/test1.build/Debug-iphonesimulator/test1.build/Objects-normal/i386/C4WorkSpace.o 
    /Users/me/Documents/TradeCity/test1/test1/Library/libC4.a(C4WorkSpace.o) 
duplicate symbol _OBJC_IVAR_$_C4AppDelegate._window in: 
    /Users/me/Library/Developer/Xcode/DerivedData/test1-ccqtiznytmfywgdvbkcvvdlombrb/Build/Intermediates/test1.build/Debug-iphonesimulator/test1.build/Objects-normal/i386/C4AppDelegate.o 
    /Users/me/Documents/TradeCity/test1/test1/Library/libC4.a(C4AppDelegate.o) 
duplicate symbol _OBJC_IVAR_$_C4AppDelegate._workspace in: 
    /Users/me/Library/Developer/Xcode/DerivedData/test1-ccqtiznytmfywgdvbkcvvdlombrb/Build/Intermediates/test1.build/Debug-iphonesimulator/test1.build/Objects-normal/i386/C4AppDelegate.o 
    /Users/me/Documents/TradeCity/test1/test1/Library/libC4.a(C4AppDelegate.o) 
duplicate symbol _OBJC_METACLASS_$_C4AppDelegate in: 
    /Users/me/Library/Developer/Xcode/DerivedData/test1-ccqtiznytmfywgdvbkcvvdlombrb/Build/Intermediates/test1.build/Debug-iphonesimulator/test1.build/Objects-normal/i386/C4AppDelegate.o 
    /Users/me/Documents/TradeCity/test1/test1/Library/libC4.a(C4AppDelegate.o) 
duplicate symbol _OBJC_CLASS_$_C4AppDelegate in: 
    /Users/me/Library/Developer/Xcode/DerivedData/test1-ccqtiznytmfywgdvbkcvvdlombrb/Build/Intermediates/test1.build/Debug-iphonesimulator/test1.build/Objects-normal/i386/C4AppDelegate.o 
    /Users/me/Documents/TradeCity/test1/test1/Library/libC4.a(C4AppDelegate.o) 
ld: 6 duplicate symbols for architecture i386 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

6 i386硬件架構重複的符號具有相同名稱的全局變量(我將在一秒內編輯併發布鏈接)?

我使用的XCode 4.5.2和OSX 10.7.5

我沒有得到這個錯誤,當我嘗試使用tumblrsdk示例項目(使用的CocoaPods導入後),我不明白當我在沒有導入tumblrsdk的情況下在c4中構建項目時。

+0

如果你可以發佈你的項目到github回購,我將能夠找出發生了什麼。 –

+0

這裏是https://github.com/gregtemp/test1 –

回答

2

我在3種不同的場景中測試了這個問題。

首先,我使用C4單視圖模板創建了一個新項目。我這樣做有:

  • 的Xcode 4.6.3,舊的安裝程序,預編譯的lib
  • 的Xcode 5,新的安裝程序,原始文件
  • 的Xcode 5,新的安裝程序,預編譯的lib

在所有3我做以下事情,從終端(在我的comp上安裝cocoapods後):

  1. 導航到項目的頂層目錄
  2. $莢初始化
  3. 開莢在編輯文件
  4. 取消註釋並設置:平臺:IOS,「6.1」
  5. 添加到目標:莢「TMTumblrSDK」
  6. 回到終端,運行:吊艙安裝
  7. 打開項目的新創建的工作區
  8. 構建+運行

對於Xcode的5個項目(包括與.LIB和原始FIL es)編譯並運行的項目只有一些小警告(在CocoaPods方面,因爲我對編譯器設置有嚴格的限制)。

對於Xcode 4.6.3項目,我收到了與您收到的警告相同的警告。

不幸的是,4.6.3項目模板不再受支持。如果您可以熟悉Xcode 5以及新的安裝程序,那麼這對您會有幫助。