Xcode 4 iOS 4.3 SDK bad codegen, pointer diff linker error

Just a FYI - with the new SDK rollout I received linker errors like this in all my projects:

ld: bad codegen, pointer diff in MSA::FluidDrawerBase::FluidDrawerBase()to global weak symbol vtable for ofBaseDrawsfor architecture armv7
collect2: ld returned 1 exit status

With the actual location of the error varying.

The solution:

Clean project

Go to build settings in both your main project and the OF library and change

GCC 4.2 Code Generation line

Symbols hidden by default

to “YES”

and rebuild.

Bump to this, great advice saved me a lot of time. XCode 4 will be mandatory for new iOS releases from now on I’m pretty positive, so this change needs to be done to everything for OF.

Also, delete your provisioning profiles and certificates and reinstall!