Re: Missing libstdc++ symlink in the 10.6 SDK from Xcode 4.3?
Re: Missing libstdc++ symlink in the 10.6 SDK from Xcode 4.3?
- Subject: Re: Missing libstdc++ symlink in the 10.6 SDK from Xcode 4.3?
- From: Andreas Grosam <email@hidden>
- Date: Mon, 27 Feb 2012 12:27:14 +0100
On Feb 27, 2012, at 8:38 AM, Jamie Kirkpatrick wrote:
> Can someone confirm if they see the same thing as me here:
>
> jkp@KidA [09:48:39] [~] -> % ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/usr/lib/libstdc++* /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/usr/lib/libstdc++-static.a /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/usr/lib/libstdc++.6.0.9.dylib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/usr/lib/libstdc++.6.dylib
>
> This causes problems for any code that tries to link to libstdc++ without specifying a version.
When building with Xcode and Base SDK set to 10.6, I get no linker errors. Should we?
When building with Xcode you should specify the Base SDK. This sets the compiler option -sysroot, e.g.:
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk
Internally, the driver uses this path to set library paths correspondingly.
If you investigate a bit deeper, you get this information with:
$ g++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -print-search-dirs
This prints out a lot of paths, including the *actual* library search path for the standard libs, e.g.:
...
libraries: =/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/lib/i686-apple-darwin11/4.2.1/x86_64/
:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/lib/x86_64/
:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/usr/lib/i686-apple-darwin11/4.2.1/x86_64/
...
...
:/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/
...
The first path that contains a file or link 'libstdc++.dylib' is the last path, shown in the partial list above. This is a link which points to /usr/lib/libstdc++.6.dylib which in turn points to /usr/lib/libstdc++.6.0.9.dylib.
The product is finally dynamically linked against
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)
on my Lion 10.7.3.
Unfortunately, clang++ does not print much useful (that is complete) information with option -print-search-dirs.
But FWIW, the sheer number of paths printed with option -print-search-dirs worries me whether this is actually correct.
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