为 Iphone 设备构建时出现链接错误
嗨,我已经在这些错误中挣扎了一天。
我正在使用 TouchJSON 框架(http://code.google.com/p/touchcode/< /a>) 对于 iphone。一切在 iphone 模拟器上编译都很好,但是当我尝试在设备上编译时,出现链接错误。
未定义的符号:
"___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 添加到链接器标志,但仍然错误。任何帮助或提示将不胜感激。
Hi i've been struggling with these errors for a day now.
I'm using the TouchJSON framework(http://code.google.com/p/touchcode/) for the iphone.Everything compiles fine on the iphone simulator but when i try to compile on the device i get link errors.
Undefined symbols:
"___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 is a class of mine which uses the touchJSON methods to parse and generate JSON. I think it's the touchJSON library that's causing most of the linking errors so i tried another framework json framework but it still causes 1 error.
I tried changing from "debug" to "release" but still gives the same errors. I then tried adding -all_load and -ObjC to the linker flags but it still errors. Any help or hints would be appreciated.
您可以尝试使用 json-framework 而不是touchJSON 如果您无法修复链接器错误。
You can try to use json-framework instead of touchJSON if you don't manage to fix the linker errors.