2012-01-13 63 views
2

我正在使用第三方库,并在xcode4中使用ios5获得了以下链接错误。有人能告诉我如何解决这个有点错误吗?非常感谢!!如何修复xcode4(和ios5)中的链接错误

Undefined symbols for architecture i386: 
    "std::string::assign(char const*, unsigned long)", referenced from: 
     meatloaf::boundaries::boundaries(std::vector<meatloaf::scanline, std::allocator<meatloaf::scanline> >) in libScannerKit.a(boundaries.o) 
     meatloaf::boundaries::find_boundaries() in libScannerKit.a(boundaries.o) 
    "std::string::_Rep::_S_empty_rep_storage", referenced from: 
     meatloaf::boundaries::boundaries() in libScannerKit.a(boundaries.o) 
+0

你在Obj-C++模式下编译?或者只是Obj-C模式? – 2012-01-13 06:50:08

+0

哪个第三方库?您可能需要导入一些框架或在标题搜索路径/其他链接器标志中包含一些路径 – vishy 2012-01-13 06:56:33

+0

您的lib是否具有i386代码?或者只是armv6/7?试着用'lipo -info/path/to/your/lib' – V1ru8 2012-01-13 07:09:29

回答

3

感谢大家的帮助,真心赞赏!我终于发现,我需要为调试和发布设置“其他链接器标志”为“-all_load -lstdC++”。在项目设置的“构建设置/链接/其他链接器标志”