iOS5中的Json显示错误

发布于 2024-12-22 11:45:51 字数 1908 浏览 0 评论 0原文

"_OBJC_CLASS_$_SBJSON", referenced from:

Objc-class-ref in JparseViewController.o

Symbol(s) not found for architecture i386

Clang: error: linker command failed with exit code 1 (use -v to see invocation)

Ld /Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Products/Debug-iphonesimulator/Jparse.app/Jparse_armv7 armv7 i386
    cd "/Users/mag1/Documents/Xcode Projects/Jparse"
    setenv MACOSX_DEPLOYMENT_TARGET 10.6
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Products/Debug-iphonesimulator -F/Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Products/Debug-iphonesimulator -filelist /Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Intermediates/Jparse.build/Debug-iphonesimulator/Jparse.build/Objects-armv7/i386/Jparse.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Products/Debug-iphonesimulator/Jparse.app/Jparse_armv7

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_SBJSON", referenced from:
      objc-class-ref in JparseViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我从下载的示例中获取了 JSON 框架文件。这些示例工作正常,但我的项目显示上述错误。

"_OBJC_CLASS_$_SBJSON", referenced from:

Objc-class-ref in JparseViewController.o

Symbol(s) not found for architecture i386

Clang: error: linker command failed with exit code 1 (use -v to see invocation)

Ld /Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Products/Debug-iphonesimulator/Jparse.app/Jparse_armv7 armv7 i386
    cd "/Users/mag1/Documents/Xcode Projects/Jparse"
    setenv MACOSX_DEPLOYMENT_TARGET 10.6
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Products/Debug-iphonesimulator -F/Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Products/Debug-iphonesimulator -filelist /Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Intermediates/Jparse.build/Debug-iphonesimulator/Jparse.build/Objects-armv7/i386/Jparse.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Products/Debug-iphonesimulator/Jparse.app/Jparse_armv7

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_SBJSON", referenced from:
      objc-class-ref in JparseViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I got JSON framework files from downloaded example. The examples are working perfectly, but my project showing above errors.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

煞人兵器 2024-12-29 11:45:51

未找到架构 i386 的符号

在以下情况下会发生上述错误:

  1. 您试图在 iPhone/iPad 模拟器中运行应用程序
  2. 该库仅构建为在物理设备上运行,并且不支持在模拟器中运行。

要解决此问题,您需要将 i386 添加到 SBJSON 库构建目标的有效架构中,或者使用物理设备测试您的应用程序。

Symbol(s) not found for architecture i386

The above error occurs in the following situation:

  1. You were trying to run your application in the iPhone/iPad Simulator
  2. The library was only built to run on the physical devices, and does not support being run in the Simulator.

To resolve this, you either need to add i386 to the Valid Architectures of the SBJSON library build target, or test your application using a physical device.

骷髅 2024-12-29 11:45:51

您没有将 SBJSON.m 文件添加到您的目标中。检查该文件的属性面板,应该有一个复选框指示它分配给哪个目标。您可能根本忘记将 SBJSON.m 复制到您的项目中。

You didn't add the SBJSON.m file to your target. Check the properties panel for this file, and there should be a checkbox indicating which target it is assigned to. You may have simply forgotten to copy SBJSON.m into your project at all.

踏雪无痕 2024-12-29 11:45:51

转到 Projectapp -> 构建阶段 -> compileSources

此处添加带有 + 图标的 JSON 的所有 .m 文件。问题将会得到解决

go to Projectapp -> Buildphases -> compileSources

here to add all .m files of JSON with + icon. problem will be resolved

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文