在 xcode4 上安装 json 框架时的问题
你好 我正在尝试安装 json 框架。根据安装说明,我必须从项目中的 json-framwork/classes 复制所有类!我这样做了,但收到此错误:
ld:重复符号 _OBJC_METACLASS_$_SBJsonParser 中/Users/user/Library/Developer/Xcode/DerivedData/testhttp-eavsbuatbfoagsgbqfnevfpjxxfc/Build/Intermediates/testhttp.build/Debug-iphonesimulator/testhttp.build/Objects-normal/i386/SBJsonParser-4254E5B76E32172.o 和 /Users/user/Library/Developer/Xcode/DerivedData/testhttp-eavsbuatbfoagsgbqfnevfpjxxfc/Build/Intermediates/testhttp.build/Debug-iphonesimulator/testhttp.build/Objects-normal/i386/SBJsonParser-46310C881BFA9776.o 对于架构 i386 收集2:ld 返回 1 退出状态命令 /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 失败,退出代码为 1
我在这里做错了什么?
Hello
I am trying to install json framework. According to installation instructions I have to copy all the classes from json-framwork/classes in my project! I did that and I am getting this error:
ld: duplicate symbol
_OBJC_METACLASS_$_SBJsonParser in /Users/user/Library/Developer/Xcode/DerivedData/testhttp-eavsbuatbfoagsgbqfnevfpjxxfc/Build/Intermediates/testhttp.build/Debug-iphonesimulator/testhttp.build/Objects-normal/i386/SBJsonParser-4254E5B76E32172.o
and
/Users/user/Library/Developer/Xcode/DerivedData/testhttp-eavsbuatbfoagsgbqfnevfpjxxfc/Build/Intermediates/testhttp.build/Debug-iphonesimulator/testhttp.build/Objects-normal/i386/SBJsonParser-46310C881BFA9776.o
for architecture i386 collect2: ld
returned 1 exit status Command
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2
failed with exit code 1
What I am doing wrong here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请查看:
iPhone:重复符号错误?
在右侧边栏中选择项目导航器。双击您的项目(顶部元素)。
现在打开构建阶段选项卡。有一个部分称为编译源。打开它并检查错误引用的文件是否存在重复条目。
我安装的 json-framework
刚刚将这些文件添加到我的项目中
每个 .m 文件仅在此处出现一次
此处输入图像描述">
Please have a look at:
iPhone: Duplicate Symbol Error?
Select the project navigator in the right sidebar. Double click your project(top element).
Now open the build phases tab. There is a section which is called Compile Sources. Open it an check if there is a duplice entry of the file which the error refers to.
My Installation of the json-framework
Just added these files to my project
Each .m file is here only once
In the class I need JSON parsing I'll just import:
我只是从 JSON 框架中删除了编译器给我错误的 .m 和 .h 文件,最后我只是保留了 JSON 框架:NSObject+SBJSON、NSSTring+SBJSON .h 和 m。
这对我有用,我希望它有帮助:D
I just erase the .m and .h files from JSON Framework wich the compilator was giving me errors, at the end I just keep from the JSON Framework: NSObject+SBJSON, NSSTring+SBJSON .h and m.
This worked for me, I hope it helps :D