STD linker error with Apple LLVM 4.1

后端 未结 6 469
無奈伤痛
無奈伤痛 2020-12-04 19:49

I\'ve got a large static library in C++ with bits of Objective-C originally built for iOS (armv7).

I built a OS X (64-bit Intel x86_64) version of it, but as soon as

6条回答
  •  旧时难觅i
    2020-12-04 20:44

    I had this problem after putting all C++ files into a separate library. I did set the settings of all projects to use libc++, but the linker does not link with libc++. If I add a C++ file to the main project, the problem would disappear. To fix this, you can add '-lc++' on the "Other Linker Flags" section of the main project. This would force XCode to link to libc++.

    EDIT: As the other poster said, XCode may be behaving correctly. I had expected it to know to add C++ linkage because the C++ lib source code is on the same workspace.

提交回复
热议问题