1

I am trying to build a dylib using Xcode 4.4, which previously built fine. I have run into 2 issues:

  1. If I build against the 10.7 sdk, it builds fine. However when testing on 10.6.8 I get the following error:

Dyld Error Message: Symbol not found: _wcsdup Referenced from: /lib/Release/libwx_baseu-2.9.dylib Expected in: /usr/lib/libSystem.B.dylib

  1. If I build against the 10.6 sdk (extracted from a download of Xcode 4.3.3), I get the following link error:

Ld build/Debug/libCodec.dylib normal i386 cd /Developer/Projects/Common/osx setenv MACOSX_DEPLOYMENT_TARGET 10.6 /Applications/Xcode.app/Contents/Developer/usr/bin/llvm-g++-4.2 -arch i386 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -L/Developer/Projects/Common/osx/build/Debug -L/Developer/Packages/libsndfile/osx/lib -L/Developer/Packages/wxWidgets/build-debug/lib -F/Developer/Projects/Common/osx/build/Debug -filelist /Developer/Projects/Common/osx/build/Common.build/Debug/Codec.build/Objects-normal/i386/Codec.LinkFileList -install_name "@rpath/libCodec.dylib" -mmacosx-version-min=10.6 -lSampleFormat -lSoundFile -lsndfile.1 -lwx_baseu-2.9 -single_module -compatibility_version 1 -current_version 1 -o /Developer/Projects/Common/osx/build/Debug/libCodec.dylib

ld: library not found for -lstdc++ collect2: ld returned 1 exit status Command /Applications/Xcode.app/Contents/Developer/usr/bin/llvm-g++-4.2 failed with exit code 1

I would prefer to build against the 10.6 sdk, since i need to support 10.6.8. In all cases I set my min deployment target to 10.6, however that hasn't helped.

Update (08/05/2012): I resolved the error I was receiving when building against the 10.6 SDK by changing to apple's devualt llvm 4.0 compiler (instead of the llvm gcc compiler which I was using).

Tamer
  • 876
  • 2
  • 10
  • 22

1 Answers1

2

Just because you manually copied the 10.6 from an older version of Xcode doesn't mean your new Xcode is going to know what to do with it.

But do not fret, simply set the Deployment Target (as you already have done) to 10.6 and link against whatever the current SDK that is shipping with Xcode 4.4.

You'll run on 10.6 just fine.

The same concept applies for iOS, and here's a related question that adds some extra detail (in terms of iOS, but the same philosophy applies for MacOS).

Community
  • 1
  • 1
Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
  • I did try building against the current sdk in Xcode 4.4, which is 10.7. However as I mentioned above, I got the above link error. – Tamer Aug 02 '12 at 00:06