Question

I'm using CocoaPods to install the tumblr sdk into a c4 project. Without adding any code into the c4workspace i get the following error:

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 duplicate symbols for architecture i386

I checked out another question and the guy who answered said that it was something to do with having two global variables with the same name (I'll edit and post the link in a sec)?

I'm using XCode 4.5.2 and OSX 10.7.5

I don't get this error when I try to using the tumblrsdk example projects (after using cocoapods to import), and I dont get it when i build a project in c4 without importing the tumblrsdk.

Was it helpful?

Solution

I tested the issue in 3 different scenarios.

First, I created a new project using the C4 Single-View Template. I did this with:

  • Xcode 4.6.3, old installer, precompiled lib
  • Xcode 5, new installer, raw files
  • Xcode 5, new installer, precompiled lib

In all 3 I do the following, from Terminal (after installing cocoapods on my comp):

  1. Navigate to the project's top directory
  2. $ pod init
  3. open pod file in editor
  4. uncomment and set: platform :ios, "6.1"
  5. add to target: pod 'TMTumblrSDK'
  6. go back to terminal and run: pod install
  7. open the project's newly created workspace
  8. build + run

For the Xcode 5 projects (both with the .lib and the raw files) the project compiled and ran with only some minor warnings (on the CocoaPods side of things, because I have tight restrictions on my compiler settings).

For the Xcode 4.6.3 project I received the same warning that you received.

Unfortunately, the 4.6.3 project templates are no longer being supported. If you can get your hands on Xcode 5, and the new installer, then this will work for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top