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

0.26-rc build isue #7566

Closed
5 tasks
charlesluo2014 opened this issue May 14, 2016 · 27 comments
Closed
5 tasks

0.26-rc build isue #7566

charlesluo2014 opened this issue May 14, 2016 · 27 comments
Labels
Help Wanted :octocat: Issues ideal for external contributors. Resolution: Locked This issue was locked by the bot.

Comments

@charlesluo2014
Copy link

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

None of the above, create a bug report

Make sure to add all the information needed to understand the bug so that someone can help. If the info is missing we'll add the 'Needs more information' label and close the issue until there is enough information.

  • Provide a minimal code snippet / rnplay example that reproduces the bug.
  • Provide screenshots where appropriate
  • What's the version of React Native you're using?
  • Does this occur on iOS, Android or both?
  • Are you using Mac, Linux or Windows?
@chirag04
Copy link
Contributor

you need to add -lc++ in Other Linker Flagsin your xcode project build settings.

@bestander
Copy link
Contributor

Anyone wants to submit a Pull Request that updates XCode project with react-native upgrade command?

@bestander
Copy link
Contributor

The change should be similar to 8aa82d3

@mkonicek
Copy link
Contributor

you need to add -lc++ in Other Linker Flags

What changed in 0.26 that we now need the new linker flag?

@mkonicek
Copy link
Contributor

mkonicek commented May 17, 2016

The change should be similar to 8aa82d3

But e2e tests pass so the new project template is correct?

@bestander
Copy link
Contributor

| But e2e tests pass so the new project template is correct?

E2e failed to link after this change 033e7c8

Here is log: https://travis-ci.org/facebook/react-native/jobs/124793055

@bestander
Copy link
Contributor

|| The change should be similar to 8aa82d3
| But e2e tests pass so the new project template is correct?

The new project template is now correct and e2e pass.
But upgrade for existing projects requires adding lc++ flag to be added.

@grabbou
Copy link
Contributor

grabbou commented May 17, 2016

Do we even have a clean interface for doing that? Currently it looks that we just copy files and merge them with the user ones. That would be super easy with rnpm to just read the project, check for flags and add lc++ when its' missing.

We might not be able to do it right now as RNPM is still pending merge, but we can make a really small plugin for rnpm and just advise users to install them, e.g.:

rnpm install rnpm-plugin-upgrade
rnpm upgrade 0.26

which upgrades your project from X to Y (in this case 0.26) applying all defined upgrades one after another.

We can merge it later to upgrade itself as well.

CC: @mkonicek @bestander

@bestander
Copy link
Contributor

Can we script

npm install rnpm
rnpm install rnpm-plugin-upgrade
rnpm upgrade 0.26

into the update script?

For the one-off thing until rnpm is merged.
This way we don't need to explain this what users need to install

@grabbou
Copy link
Contributor

grabbou commented May 17, 2016

That would work indeed. I'll update this issue in the morning once the upgrade code is there.

@grabbou
Copy link
Contributor

grabbou commented May 18, 2016

@bestander where do you think it's appropriate to add that npm install thing?

@bestander
Copy link
Contributor

@grabbou after thinking about it and looking at https://github.com/facebook/react-native/blob/master/local-cli/upgrade/upgrade.js, we don't put any modifying commands to this script.

I think we should do similar to this: https://github.com/facebook/react-native/blob/master/local-cli/upgrade/upgrade.js#L49:

  • check that xcodeproject is not upgraded
  • provide a chalk.yellow guide how to upgrade it via the commands I pasted above

@bestander
Copy link
Contributor

bestander commented May 18, 2016

And @grabbou kudos for doing that!
Whatever assistance you need - just let me know

@grabbou
Copy link
Contributor

grabbou commented May 18, 2016

Sounds good!

https://github.com/rnpm/rnpm-plugin-upgrade

Here's the plugin with the installation steps. I decided to align its versions with the React Native ones, so it's easier for us to handle changes. I already published it to npm and it seems to be working just fine.

We can add detection of the version later, for now I just made it dead simple.

@bestander
Copy link
Contributor

sd

@grabbou
Copy link
Contributor

grabbou commented May 18, 2016

Here's the PR: #7614

@sangdth
Copy link

sangdth commented May 19, 2016

@chirag04 You saved my life!

@deju
Copy link

deju commented Jul 13, 2016

@chirag04 It is ok after i added -lc++ in Other Linker Flags.

@thorbenandresen
Copy link

thorbenandresen commented Jul 13, 2016

I have added https://github.com/smore-inc/react-native-segment-io-analytics and I am now getting this issue.

  • I have followed the instructions and build from the xcworkspace file.
  • I have a clean 0.29 awesomeProject - so all the linker flags are fine ($(inherited), -ObjC, -lc++)
  • It worked fine before in my 0.27 project (upgraded from the early 0.20s)

Is this a RN issue or an issue of the package?

Undefined symbols for architecture x86_64:
  "std::terminate()", referenced from:
      ___clang_call_terminate in libReact.a(RCTJSCExecutor.o)
  "operator delete[](void*)", referenced from:
      -[RCTJSCExecutor dealloc] in libReact.a(RCTJSCExecutor.o)
      executeRandomAccessModule(RCTJSCExecutor*, unsigned int, unsigned long, unsigned long) in libReact.a(RCTJSCExecutor.o)
      readRAMBundle(std::__1::unique_ptr<__sFILE, int (*)(__sFILE*)>, RandomAccessBundleData&) in libReact.a(RCTJSCExecutor.o)
      RandomAccessBundleData::~RandomAccessBundleData() in libReact.a(RCTJSCExecutor.o)
  "operator new[](unsigned long)", referenced from:
      executeRandomAccessModule(RCTJSCExecutor*, unsigned int, unsigned long, unsigned long) in libReact.a(RCTJSCExecutor.o)
      readRAMBundle(std::__1::unique_ptr<__sFILE, int (*)(__sFILE*)>, RandomAccessBundleData&) 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(RCTJSCWrapper*, OpaqueJSContext const*, OpaqueJSValue const*) in libReact.a(RCTJSCExecutor.o)
      +[RCTJSCExecutor runRunLoopThread] in libReact.a(RCTJSCExecutor.o)
      -[RCTJSCExecutor init] in libReact.a(RCTJSCExecutor.o)
      -[RCTJSCExecutor initWithUseCustomJSCLibrary:] 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)

@thorbenandresen
Copy link

solved! Had to add -lc++ to Other linker flags for my TEST target as well

@cjmling
Copy link

cjmling commented Aug 24, 2016

@thorbenandresen Thanks when u said TEST target , I didn't understand what does it meant and where was it. Finally figure it out and here it was.
screen shot 2559-08-24 at 6 39 41 pm

@xixixao
Copy link
Contributor

xixixao commented Jan 8, 2017

Ran into this too. Had to also add to Test target.

@woonmayer
Copy link

2017-01-09 3 47 02

Test target doesn't show 'Other Linker Flags' by default.
You should change 'Basic' to 'All' to be able to see

@kadzier
Copy link

kadzier commented Jan 13, 2017

Yep just ran into this issue when I changed my scheme to run in Release configuration (worked during debug). Had to add -lc++ to the test target as pictured by @mazicky

@hiddentao
Copy link

I just had to do this too, thanks @mazicky and everyone else.

@heathbm
Copy link

heathbm commented Feb 1, 2017

For me the only way to fix the issue was to add -lc++ to the other linker flags of the project aswell as the target and tests.

@phuongit0301
Copy link

@thorbenandresen, thanks pro

@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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Help Wanted :octocat: Issues ideal for external contributors. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests