8

I followed this steps: https://github.com/ShareKit/ShareKit/wiki/Installing-sharekit to install the Sharekit. But I am facing some errors still. I am not sure how to solve this problems.

The errors:

Undefined symbols for architecture i386:
  "_ACAccountTypeIdentifierFacebook", referenced from:
      +[FBSession renewSystemAuthorization] in libShareKit.a(FBSession.o)
  "_ACFacebookAppIdKey", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in libShareKit.a(FBSession.o)
  "_ACFacebookAudienceEveryone", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in libShareKit.a(FBSession.o)
  "_ACFacebookAudienceFriends", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in libShareKit.a(FBSession.o)
  "_ACFacebookAudienceKey", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in libShareKit.a(FBSession.o)
  "_ACFacebookAudienceOnlyMe", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in libShareKit.a(FBSession.o)
  "_ACFacebookPermissionsKey", referenced from:
      -[FBSession authorizeUsingSystemAccountStore:accountType:permissions:defaultAudience:isReauthorize:] in libShareKit.a(FBSession.o)
  "_OBJC_CLASS_$_ACAccountStore", referenced from:
      objc-class-ref in libShareKit.a(FBSession.o)
  "_OBJC_CLASS_$_ASIdentifierManager", referenced from:
      objc-class-ref in libShareKit.a(FBSettings.o)
  "_OBJC_CLASS_$_SLComposeViewController", referenced from:
      objc-class-ref in libShareKit.a(FBNativeDialogs.o)
  "_SLServiceTypeFacebook", referenced from:
      +[FBNativeDialogs composeViewControllerWithSession:handler:] in libShareKit.a(FBNativeDialogs.o)
  "_sqlite3_bind_double", referenced from:
      -[FBCacheIndex _updateEntryInDatabaseForKey:entry:] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _writeEntryInDatabase:] in libShareKit.a(FBCacheIndex.o)
  "_sqlite3_bind_int", referenced from:
      -[FBCacheIndex _updateEntryInDatabaseForKey:entry:] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _writeEntryInDatabase:] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _trimDatabase] in libShareKit.a(FBCacheIndex.o)
  "_sqlite3_bind_text", referenced from:
      -[FBCacheIndex _updateEntryInDatabaseForKey:entry:] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _writeEntryInDatabase:] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _readEntryFromDatabase:] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _readEntriesFromDatabase:excludingFragment:] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _removeEntryFromDatabaseForKey:] in libShareKit.a(FBCacheIndex.o)
  "_sqlite3_close", referenced from:
      ___23-[FBCacheIndex dealloc]_block_invoke_0 in libShareKit.a(FBCacheIndex.o)
  "_sqlite3_column_double", referenced from:
      -[FBCacheIndex _createCacheEntityInfo:] in libShareKit.a(FBCacheIndex.o)
  "_sqlite3_column_int", referenced from:
      -[FBCacheIndex _createCacheEntityInfo:] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _fetchCurrentDiskUsage] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _trimDatabase] in libShareKit.a(FBCacheIndex.o)
  "_sqlite3_column_text", referenced from:
      -[FBCacheIndex _createCacheEntityInfo:] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _trimDatabase] in libShareKit.a(FBCacheIndex.o)
  "_sqlite3_errmsg", referenced from:
      ___23-[FBCacheIndex dealloc]_block_invoke_0 in libShareKit.a(FBCacheIndex.o)
      _releaseStatement in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _updateEntryInDatabaseForKey:entry:] in libShareKit.a(FBCacheIndex.o)
      _initializeStatement in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _writeEntryInDatabase:] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _readEntryFromDatabase:] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _readEntriesFromDatabase:excludingFragment:] in libShareKit.a(FBCacheIndex.o)
      ...
  "_sqlite3_exec", referenced from:
      ___36-[FBCacheIndex initWithCacheFolder:]_block_invoke_0 in libShareKit.a(FBCacheIndex.o)
  "_sqlite3_finalize", referenced from:
      _releaseStatement in libShareKit.a(FBCacheIndex.o)
  "_sqlite3_open_v2", referenced from:
      ___36-[FBCacheIndex initWithCacheFolder:]_block_invoke_0 in libShareKit.a(FBCacheIndex.o)
  "_sqlite3_prepare_v2", referenced from:
      _initializeStatement in libShareKit.a(FBCacheIndex.o)
  "_sqlite3_reset", referenced from:
      _initializeStatement in libShareKit.a(FBCacheIndex.o)
  "_sqlite3_step", referenced from:
      -[FBCacheIndex _updateEntryInDatabaseForKey:entry:] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _writeEntryInDatabase:] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _createCacheEntityInfo:] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _fetchCurrentDiskUsage] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _removeEntryFromDatabaseForKey:] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _dropTrimmingTable] in libShareKit.a(FBCacheIndex.o)
      -[FBCacheIndex _trimDatabase] in libShareKit.a(FBCacheIndex.o)
      ...
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Need some guidance on how to solve this... Would appreciate any help...

laksh
  • 2,209
  • 6
  • 21
  • 25
  • 1
    I am getting similar errors, but with architecture armv7. Getting the same _OBJC_CLASS_$_ACAccountStore error + a bunch of other sqlite error like you are. If I find a solution I'll try and post it here. Hopefully we can get this figured out. – Gowiem Nov 18 '12 at 23:00
  • I fixed the Linker Errors by removing the "-ObjC -all_load" which was suggested by this post: [Sharekit Issue #408](https://github.com/ShareKit/ShareKit/issues/408) – Gowiem Nov 18 '12 at 23:46

4 Answers4

20

I have the same problem, switching to ShareKit library with new Facebook SDK 3.0.

You need to add these frameworks and libraries to solve errors:

Social.framework
AdSupport.framework
Accounts.framework
libsqlite3.dylib
Mikk.22
  • 201
  • 1
  • 2
  • 4
    If building for iOS 5.X these frameworks should be marked optional correct? Since they are only required by the new Facebook SDK? – Gowiem Nov 27 '12 at 17:27
  • Yes, they should. BTW, this answer worked, and it's better than the accepted one, since it doesn't force you to remove macros necessary for other frameworks. – csotiriou Jan 18 '13 at 13:58
3

I do not think removing other linker flags is a good idea.

See linking objective-c categories in a static library and http://www.cocoanetics.com/2011/12/sub-projects-in-xcode/

New facebook SDK needs several frameworks, do not forget to add them to your project:

  • social.framework
  • accounts.framework
  • adsupport.framework
  • libsqlite3.dylib
Community
  • 1
  • 1
Vilém Kurz
  • 3,401
  • 2
  • 34
  • 43
2

Just add

libsqlite3.dylib

from linked frameworks and libraries of your project in Xcode

dip
  • 129
  • 1
  • 4
0

This is what finally worked for me: http://t2526.codeinpro.us/q/51501c3fe8432c042610dc68

Removing -ObjC and -all_load from Other Linker Flags in Build Settings of Xcode.

Mark
  • 2,666
  • 3
  • 25
  • 29