This question is related to this: "bad codegen, diff pointer" linker error with Xcode 4 and "bad codegen, diff pointer in boost" error in 32-bit assembly and Xcode 3.2.6 and 4 linker errors ld: bad codegen, diff pointer in ... a global weak symbol
I am currently updating all my projects to Xcode4, and I am experiencing some weird things. - This error only occurs if I create a universal binary or 32-bit version. If I stick with only 64 bits, everything will work fine. I myself create my own static library, where right now I am not using any visibility parameters (i.e. the attribute ((visibility ("by default"))) in this code. If I link this library and try to build a project, then the exact error is:
ld: bad codegen, diff pointer in Motor :: Core :: DefaultStoragePolicy :: DefaultStoragePolicy (myWindowContent * const &) for the global weak character Motor :: Core :: NullPointerException :: ~ NullPointerException () for i386 architecture
It is in my SmartPtr class, which can throw a NullPointerException (just comes from std :: exception). If I explicitly set the visibility of the NullPointerException class to hidden, everything compiles fine, but hiding the exception cannot be good! I tried the following compilers: GCC 4.2, LLVM-GCC 4.2 and LLVM 2.1 all with the same problem. Installation Symbols hidden by default , until yes in the project / goal settings did not work (and this is also not what I want). Since I can solve this without hiding my exceptions (this is absurd). Should I live with him, is that a mistake? Looking forward to your ideas, thanks!
source share