0

I've been trying to integrate Sharekit to a project that already has google analytics.

I followed the installation guide on the sharekit git wiki which told me to include the 'other linker flags' "-ObjC" and "-all_load"

However when I try compiling I am getting duplicate symbol errors in google analytics, such as:

    duplicate symbol _OBJC_IVAR_$_OAServiceTicket.data in:
/Users/x3ro/Library/Developer/Xcode/DerivedData/APPNAME-bgfudbwainndvsdmvtafsrwfryvz/Build/Intermediates/APPNAME.build/Debug-iphonesimulator/APPNAME.build/Objects-normal/i386/OAServiceTicket.o
/Users/x3ro/APPNAME/Developer/Xcode/DerivedData/APPNAME-bgfudbwainndvsdmvtafsrwfryvz/Build/Products/Debug-iphonesimulator/libShareKit.a(OAServiceTicket.o)

Removing the flags solves these errors, however I know this isn't a good idea and I'll very likely run into issues down the line. Any help in getting the flags and both libraries to work together would be really appreciated.

Biggs
  • 267
  • 3
  • 9

1 Answers1

0

Use the linker flag "-force_load" with the path to Sharekit.

It look like something like this:

-force_load $(BUILT_PRODUCTS_DIR)/libRestKit.a

From Apple Documentation:

-all_load forces the linker to load all object files from every archive it sees, even those without Objective-C code. -force_load is available in Xcode 3.2 and later. It allows finer grain control of archive loading. Each -force_load option must be followed by a path to an archive, and every object file in that archive will be loaded.

You can find others answers with this related post: Using the force_load linker flag with RestKit (iOS)

Community
  • 1
  • 1
Ben
  • 1,414
  • 13
  • 23