0

I was trying out google maps sdk integration with iOS 6.1. I am successfully able to populate gmap on iOS simulator by using instructions given on GMaps for iOS starting guide

Then what the issue with it: It works great when I use it as a separate project. But when I club the above project code with my existing application, then it behaves weird, and all the errors generates due to inclusion of -ObjC value in Other Linker Flags in Build Settings.

Error duplicate symbols for architecture i386

When I skip step 7 (GMaps iOS), it doesn't give errors. Due to exclusion of -ObjC value, it doesn't able to identify a specific GMaps library class and its method: [GMSCameraPosition cameraWithLatitude:longitude:zoom:]: unrecognized selector sent

My iOS application background: Using a third party library SUP (Sybase Unwired Platform). Connecting SAP to iOS application. I guess there is something ambiguous with SUP environment enablement (Build settings) when I am trying to add GMaps library.

Seeking for your advices.

Thanks!

Saxon Druce
  • 17,406
  • 5
  • 50
  • 71
turtle
  • 928
  • 1
  • 11
  • 23
  • What duplicate symbols are you getting errors for? Can you post the full error message? – Saxon Druce Mar 06 '13 at 11:10
  • ld: 431 duplicate symbols for architecture i386 – turtle Mar 06 '13 at 11:17
  • Is there a you an provide a minimal demo project reproducing your issue? I had a quick lookup for SUP an the documentation I found date back 2010 and said "Xcode 3.2.3 + iOS 4 are NOT supported." giving clear indication that either I am looking at the wrong document or you should search a different library. – Christoph Mar 08 '13 at 18:45
  • when I migrated my project from XCode 4.5.2 to 4.6, it produced approx 300 warnings. I am not sure about the cause. But this is something apart from my above discussed problem. If I work just with SUP or just with GMpas, it sounds well. But when I used both in single project following both instructions parallel, I am facing above mentioned issue. – turtle Mar 08 '13 at 19:29
  • 1
    Duplicate of: http://stackoverflow.com/questions/11090601/why-is-the-objc-linker-flag-needed-to-link-categories-in-static-libraries-llv, http://stackoverflow.com/questions/6629979/what-does-the-objc-linker-flag-do, http://stackoverflow.com/questions/8179869/should-i-include-objc-and-all-load-in-other-linker-flag-to-all-my-ios-projec – CodaFi Mar 10 '13 at 08:07
  • @CodaFi has the right answer here. additionally, in regard to the 'i386' part of the "duplicate symbols" error you are getting, that is a direct result of you saying you "ignored step 7", part of which explicitly asks you to set the architecture to arm7. – john.k.doe Mar 10 '13 at 20:10
  • I said.. If I skip step 7. I get no errors. Rather application crashes due to `[GMSCameraPosition cameraWithLatitude:longitude:zoom:]: unrecognized selector sent`. I know it's mandatory to include step 7. But it doesn't work out when I use it in my project with existing SUP APIs. Error: ` duplicate symbols for architecture i386` ... I hope you got the issue this time. – turtle Mar 11 '13 at 03:56

4 Answers4

0

There many posts on SO about the duplicate symbols for architecture i386 error. Usually it means that you defined the same symbol twice in the one namespace. The last time I got this error was because I accidentally included a .m file instead of .h header file.

Alex L
  • 8,419
  • 6
  • 43
  • 51
0

Have you checked the Build Architecture?

Try setting Build Active Architecture Only to Yes.

EsbenB
  • 3,356
  • 25
  • 44
0

I was facing the same issue Today! -ObjC linker flag - When trying to add it to "Other Linker Flags" I get an error

I solved my problem, Here is what I'd suggest. Take your original project (without Gmaps and with SUP) and add the -ObjC flag to it. Are you still getting an error? If so, take Gmaps out of the equation. If you are still getting an error check in the warnings about which files it is warning you about. My problem was that I had two files libGoogleAnalytics.a and libGoogleAnalytics_debug.a and for some reason they could not coexist with the -ObjC.

Long story short, you need to find what libraries Gmaps is using that you already have in your project and remove one of them.

Community
  • 1
  • 1
Segev
  • 19,035
  • 12
  • 80
  • 152
  • See, that is why I keep telling people to refrain from including third party libraries in their own libraries. It creates a mess. Simply tell the users of your library to link that third party library as well and everything stays well. – Till Mar 14 '13 at 22:29
  • By just linking you mean to not copy the librarie to my own or not marking the add to targets? – Segev Mar 15 '13 at 17:24
  • THANKS guys.. I'll definitely check this out and let you know. – turtle Mar 21 '13 at 06:15
0

Please try this…

step 1: Add '-ObjC' to other linker flags in 'Build Settings' of your 'target' only not to the 'project'

IKKA
  • 6,297
  • 7
  • 50
  • 88