嗨,我已经为这些错误苦苦挣扎了一天。
我在 iPhone 上使用 TouchJSON 框架( http://code.google.com/p/touchcode/ )。一切都在 iPhone 模拟器上编译得很好,但当我尝试在设备上编译时,出现链接错误。
undefined symbol :
"___switch8", referenced from:
-[NetworkController constructByteMessage:command:] in NetworkController.o
-[CJSONScanner scanJSONObject:error:] in CJSONScanner.o
"___restore_vfp_d8_d15_regs", referenced from:
+[CJSONDataSerializer initialize] in CJSONDataSerializer.o
"___save_vfp_d8_d15_regs", referenced from:
+[CJSONDataSerializer initialize] in CJSONDataSerializer.o
"___switchu8", referenced from:
-[CJSONScanner scanJSONStringConstant:error:] in CJSONScanner.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
NetworkController 是我的一个类,它使用 touchJSON 方法来解析和生成 JSON。我认为是 touchJSON 库导致了大部分链接错误,所以我尝试了另一个框架 json 框架,但它仍然导致 1 个错误。
我尝试从“调试”更改为“发布”,但仍然给出相同的错误。然后我尝试将 -all_load 和 -ObjC 添加到链接器标志,但仍然错误。任何帮助或提示将不胜感激。
最佳答案
您可以尝试使用json-framework如果您无法修复链接器错误,请使用 touchJSON 来代替。
关于iphone - 为 Iphone 设备构建时出现链接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3427137/