Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined symbols for architecture x86_64: “std::terminate()”, referenced from #7532

Closed
deju opened this issue May 12, 2016 · 10 comments
Closed
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@deju
Copy link

deju commented May 12, 2016

I got the error when i run react-native run-ios after upgraded RN to 0.26.0-rc. The old version is 0.20

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)

How can i fix it?

@charpeni
Copy link
Contributor

charpeni commented May 12, 2016

Did you do react-native upgrade ?

http://facebook.github.io/react-native/docs/upgrading.html#content

@deju
Copy link
Author

deju commented May 13, 2016

@charpeni Yes, I run the command and denied overwrite all the files.

@charpeni
Copy link
Contributor

charpeni commented May 13, 2016

@deju If you denied overwriting files, it's the cause why it doesn't work.

0.26.0-rc contains a lot of changes compared to 0.20 and you need to do react-native upgrade on each upgrade. You can use the d option to compare your files versus 0.26.0-rc template and apply it manually if you had edited something in it.

http://facebook.github.io/react-native/docs/upgrading.html#content

@charpeni
Copy link
Contributor

@facebook-github-bot answered

@ghost
Copy link

ghost commented May 13, 2016

Closing this issue as @charpeni says the question asked has been answered. Please help us by asking questions on StackOverflow. StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only.

@ghost ghost closed this as completed May 13, 2016
@ghost ghost added the Ran Commands One of our bots successfully processed a command. label May 13, 2016
@charpeni
Copy link
Contributor

Since 0.26.0-rc, you must add -lc++ to the Other flags in the xcode project. 8aa82d3

@deju
Copy link
Author

deju commented May 16, 2016

@charpeni I added -lc++, and it is ok now. But occurs more problems. The third plugin i used don't support the 0.26.0-rc, maybe i should give up to upgrading to the latest version.

@tangledfruit
Copy link

@charpeni: thanks for posting that. I wasn't otherwise aware of that change.

@mcrowe
Copy link

mcrowe commented Jun 1, 2016

I ran in to this issue as well, and the solution @charpeni proposed solved the issue. To be clear for others, if you are upgrading to 0.26+ then you need to make the following changes.

In ios/YourProject.xcodeproj/project.pbxproj, look for the two lines like OTHER_LDFLAGS = "-ObjC";. Replace them with the following:

OTHER_LDFLAGS = (
  "-ObjC",
  "-lc++",
);

This is, presumably, because the "c++" library is a new dependency of React Native, and needs to be linked when compiling.

For what it's worth, react-native upgrade is a pretty painful tool to use to discover things like this. On any non-trivial app you can't say "yes" to any of the proposed changes. Instead, you are stuck deciphering diffs and trying to figure out what changes you actually need to make. It would be crazy useful to have changes like this called out in the changelog for new releases. Of course, I know you guys are working hard and busy kicking ass...

@ikzjfr0
Copy link

ikzjfr0 commented Jan 21, 2017

Don't you think the document() should be updated to include this issue, and also #8472? It's a common issue on Xcode8 for a new user.

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

6 participants