• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Linking Against stdlibc++
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Linking Against stdlibc++


  • Subject: Linking Against stdlibc++
  • From: Andreas Grosam <email@hidden>
  • Date: Thu, 07 Jul 2011 12:35:45 +0200

Hello, 

A static library project (for iOS) with an Objective-C interface uses internally a C++ implementation.


When creating an Objective-C application, I would like to keep the app project as less modified as possible when linking against the static library. Well, usually this requires the application to be linked against the C++ library, that is libstdc++.

It seems, I have these alternatives:

1) rename the main.m file to main.mm and the app project automatically links agains libstdc++.
2) add to "Other Linker Flags" the option "-lstdc++" of the target settings of the application.
3) add the libstdc++.dylib in the "Link Binary With Libraries" section of the Build Phases in the target settings of the application.

I prefer option 1) as it seems the most reliable method, for several reasons.

However, is there any better way, possibly one which does not require to add/change application build settings or modifies any of the applications source files?


Thanks for tips!

Regards
Andreas
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Linking Against stdlibc++
      • From: David Frantz <email@hidden>
    • Re: Linking Against stdlibc++
      • From: Scott Thompson <email@hidden>
  • Prev by Date: Re: Can't run on provisioned device
  • Next by Date: Re: C++ to Low level language
  • Previous by thread: Re: C++ to Low level language
  • Next by thread: Re: Linking Against stdlibc++
  • Index(es):
    • Date
    • Thread