“bad codegen, pointer diff” linker error with Xcode 4

前端 未结 5 1483
臣服心动
臣服心动 2020-12-09 11:04

Recompiling a C++ iPhone app with Xcode 4 I get this nasty linker error:

ld: bad codegen, pointer diff in __static_initialization_and_destruction_0(int, int)         


        
5条回答
  •  隐瞒了意图╮
    2020-12-09 12:09

    I ran into this problem while trying to include the boost libraries one of my projects. After finding this post, setting Symbols Hidden By Default to Yes also solved this issue for me. And I also had to make the same setting in each of the dependent projects to completely get rid of the error.

    Just FYI - This only happened on my targets that were using the clang++ stack. GCC and LLVM+GCC targets do not seem to be affected.

提交回复
热议问题