1

I am having the following errors while importing the Google Drive SDK along with the Google Objective-C client API. I'm using Xcode 6.1 with iOS 8.1 with Swift as my primary language. I've followed all the steps from the Google Drive SDK page and it still isn't working. There are linker errors and I have no idea how to fix this. Any ideas on how to fix this?

ld: warning: directory not found for option '-L/Users/salmanhasratkhan/Documents/Projects/xy/Project Shutter/iOS/Project Shutter copy/google-api-objectivec-client-read-only/Source/build/Debug-iphoneos'
ld: warning: ignoring file /Users/salmanhasratkhan/Library/Developer/Xcode/DerivedData/Project_Shutter-bcpwuavdfcgeemfbwlffsfjqczvo/Build/Products/Debug-iphoneos/libGTLTouchStaticLib.a, file was built for archive which is not the architecture being linked (arm64): /Users/salmanhasratkhan/Library/Developer/Xcode/DerivedData/Project_Shutter-bcpwuavdfcgeemfbwlffsfjqczvo/Build/Products/Debug-iphoneos/libGTLTouchStaticLib.a
Undefined symbols for architecture arm64:
  "_OBJC_METACLASS_$_GTLService", referenced from:
      _OBJC_METACLASS_$_GTLServiceDrive in GTLDrive_Sources.o
     (maybe you meant: _OBJC_METACLASS_$_GTLServiceDrive)
  "_OBJC_CLASS_$_GTLService", referenced from:
      _OBJC_CLASS_$_GTLServiceDrive in GTLDrive_Sources.o
     (maybe you meant: _OBJC_CLASS_$_GTLServiceDrive)
  "_OBJC_METACLASS_$_GTLObject", referenced from:
      _OBJC_METACLASS_$_GTLDriveAbout in GTLDrive_Sources.o
      _OBJC_METACLASS_$_GTLDriveAboutAdditionalRoleInfoItem in GTLDrive_Sources.o
      _OBJC_METACLASS_$_GTLDriveAboutExportFormatsItem in GTLDrive_Sources.o
      _OBJC_METACLASS_$_GTLDriveAboutFeaturesItem in GTLDrive_Sources.o
      _OBJC_METACLASS_$_GTLDriveAboutImportFormatsItem in GTLDrive_Sources.o
      _OBJC_METACLASS_$_GTLDriveAboutMaxUploadSizesItem in GTLDrive_Sources.o
      _OBJC_METACLASS_$_GTLDriveAboutQuotaBytesByServiceItem in GTLDrive_Sources.o
      ...
  "_OBJC_METACLASS_$_GTLQuery", referenced from:
      _OBJC_METACLASS_$_GTLQueryDrive in GTLDrive_Sources.o
     (maybe you meant: _OBJC_METACLASS_$_GTLQueryDrive)
  "_OBJC_CLASS_$_GTLObject", referenced from:
      _OBJC_CLASS_$_GTLDriveAboutAdditionalRoleInfoItem in GTLDrive_Sources.o
      _OBJC_CLASS_$_GTLDriveAboutExportFormatsItem in GTLDrive_Sources.o
      _OBJC_CLASS_$_GTLDriveAboutFeaturesItem in GTLDrive_Sources.o
      _OBJC_CLASS_$_GTLDriveAboutImportFormatsItem in GTLDrive_Sources.o
      _OBJC_CLASS_$_GTLDriveAboutMaxUploadSizesItem in GTLDrive_Sources.o
      _OBJC_CLASS_$_GTLDriveAboutQuotaBytesByServiceItem in GTLDrive_Sources.o
      _OBJC_CLASS_$_GTLDriveAbout in GTLDrive_Sources.o
      ...
  "_OBJC_METACLASS_$_GTLCollectionObject", referenced from:
      _OBJC_METACLASS_$_GTLDriveAppList in GTLDrive_Sources.o
      _OBJC_METACLASS_$_GTLDriveChangeList in GTLDrive_Sources.o
      _OBJC_METACLASS_$_GTLDriveChildList in GTLDrive_Sources.o
      _OBJC_METACLASS_$_GTLDriveCommentList in GTLDrive_Sources.o
      _OBJC_METACLASS_$_GTLDriveCommentReplyList in GTLDrive_Sources.o
      _OBJC_METACLASS_$_GTLDriveFileList in GTLDrive_Sources.o
      _OBJC_METACLASS_$_GTLDriveParentList in GTLDrive_Sources.o
      ...
  "_OBJC_CLASS_$_GTLQuery", referenced from:
      _OBJC_CLASS_$_GTLQueryDrive in GTLDrive_Sources.o
     (maybe you meant: _OBJC_CLASS_$_GTLQueryDrive)
  "_OBJC_CLASS_$_GTLCollectionObject", referenced from:
      _OBJC_CLASS_$_GTLDriveAppList in GTLDrive_Sources.o
      _OBJC_CLASS_$_GTLDriveChangeList in GTLDrive_Sources.o
      _OBJC_CLASS_$_GTLDriveChildList in GTLDrive_Sources.o
      _OBJC_CLASS_$_GTLDriveCommentList in GTLDrive_Sources.o
      _OBJC_CLASS_$_GTLDriveCommentReplyList in GTLDrive_Sources.o
      _OBJC_CLASS_$_GTLDriveFileList in GTLDrive_Sources.o
      _OBJC_CLASS_$_GTLDriveParentList in GTLDrive_Sources.o
      ...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Salman Hasrat Khan
  • 1,971
  • 1
  • 20
  • 27

1 Answers1

1

After some experimentation, I found out how to make it work on Xcode 6.1. The following is the approach I've tried. I'm documenting all because I don't know which one actually made it work.

  1. Open the GTL.xcodeproj seperately. Xcode will give you a warning and will ask you to update your settings. Chose to update it.
  2. Then navigate to the GTL project (target window) and click on GTLTouchStaticLib and chose iOS in the supported platforms (by default this is set to OS X).
  3. Close the GTL project, and then reopen your own project. Clean and build and viola the linker does not complain anymore and everything should be working fine.

I'm not sure if (1) is needed or not but since I did all these steps together, I'm not sure which is the one that actually solved the problem.

I hope this solves the problem for other people.

Salman Hasrat Khan
  • 1,971
  • 1
  • 20
  • 27