• 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
xcode 4.1 and 10.5 deployment target (applies to xcode 3.2.x as well)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

xcode 4.1 and 10.5 deployment target (applies to xcode 3.2.x as well)


  • Subject: xcode 4.1 and 10.5 deployment target (applies to xcode 3.2.x as well)
  • From: Nick Blievers <email@hidden>
  • Date: Thu, 21 Jul 2011 13:29:30 +1000

Sorry if this has come up before (surely it has?).

Problem: 
Missing libstdc++ symbols when running on 10.5

Description:
Using this document as a reference:
http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/cross_development/Configuring/configuring.html

I created a new project, command line target, c++ source, and selected a deployment target of 10.5 and Architecture of 32/64 bit and didn't touch any other settings (so base SDK was 10.7). Created a very simple program:
#include <string>
#include <iostream>
#include <ostream>

int main(int argc, char *argv[])
{
    string foo = argv[0];
    foo.insert(1, "otherfoo");
    cout << "Hello, World\n" << foo << endl
    return 0;
}


The resultant binary runs fine on 10.6 and 10.7 but not on 10.5:

$ ./sdktest 
dyld: lazy symbol binding failed: Symbol not found: __ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
  Referenced from: /Users/nick/./sdktest
  Expected in: /usr/lib/libstdc++.6.dylib

dyld: Symbol not found: __ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
  Referenced from: /Users/nick/./sdktest
  Expected in: /usr/lib/libstdc++.6.dylib

Trace/BPT trap

I have a similar problem if I build on 10.6 using xcode 3.2.

Now, I understand that the problem stems from libstdc++ and the version which is shipped with 10.5. But what do people do to avoid this? I can use gcc-4.0 in xcode 3.2.x and the problem goes away, but xcode 4.1 doesn't have that option. Also, I don't see an option in xcode 4.1 to use libc++ ?

Alternatively, I can set a base SDK of 10.5, and it will build, but this obviously locks me out of using 10.6/7 features and checking at runtime (ie weak symbols etc).


Thanks, hopefully there is an easy answer to this question!


Nick


 _______________________________________________
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: xcode 4.1 and 10.5 deployment target (applies to xcode 3.2.x as well)
      • From: Nick Blievers <email@hidden>
  • Prev by Date: Xcode 4 Release Builds
  • Next by Date: Re: Xcode 4 Release Builds
  • Previous by thread: Re: Xcode 4 Release Builds
  • Next by thread: Re: xcode 4.1 and 10.5 deployment target (applies to xcode 3.2.x as well)
  • Index(es):
    • Date
    • Thread