体系结构 x86_64 的未定义符号:“std::terminate()",引用自 [英] Undefined symbols for architecture x86_64: "std::terminate()", referenced from

查看:100
本文介绍了体系结构 x86_64 的未定义符号:“std::terminate()",引用自的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将 RN 升级到 0.26.0-rc 后运行 react-native run-ios 时出现错误.

I got the error when i run react-native run-ios after upgraded RN to 0.26.0-rc.

Undefined symbols for architecture x86_64:
      "std::terminate()", referenced from:
      ___clang_call_terminate in libReact.a(RCTJSCExecutor.o)
  "___cxa_begin_catch", referenced from:
      ___clang_call_terminate in libReact.a(RCTJSCExecutor.o)
  "___gxx_personality_v0", referenced from:
      -[RCTJavaScriptContext initWithJSContext:onThread:] in libReact.a(RCTJSCExecutor.o)
      -[RCTJavaScriptContext init] in libReact.a(RCTJSCExecutor.o)
      -[RCTJavaScriptContext invalidate] in libReact.a(RCTJSCExecutor.o)
      _RCTNSErrorFromJSError in libReact.a(RCTJSCExecutor.o)
      +[RCTJSCExecutor runRunLoopThread] in libReact.a(RCTJSCExecutor.o)
      -[RCTJSCExecutor init] in libReact.a(RCTJSCExecutor.o)
      -[RCTJSCExecutor context] in libReact.a(RCTJSCExecutor.o)
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我该如何解决?

推荐答案

已根据 以下建议解决 运行 rnpm-plugin-upgrade@0.26 后:

Resolved with the following advice after running rnpm-plugin-upgrade@0.26:

[...] 在 xcode 项目构建设置的 Other Linker Flags 中添加 -lc++.

[...] add -lc++ in Other Linker Flags in your xcode project build settings.

正如评论中指出的那样更新 target 构建设置(而不是项目).您可能还需要更新测试目标.

As pointed out in comments update target build settings (and not project). You may also need to update the Test target as well.

这篇关于体系结构 x86_64 的未定义符号:“std::terminate()",引用自的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆