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

Embedding ChakraCore into OS X application #1532

Closed
Kureev opened this issue Sep 2, 2016 · 9 comments
Closed

Embedding ChakraCore into OS X application #1532

Kureev opened this issue Sep 2, 2016 · 9 comments

Comments

@Kureev
Copy link

Kureev commented Sep 2, 2016

Hi there,

I'm trying to embed ChakraCore into OS X application. I managed to do it without any issues at compile time, but the app doesn't run tho (doesn't even hit breakpoint in int main func). Any ideas what can go wrong there?

UPD: Maybe related to #1237

@obastemur
Copy link
Collaborator

@Kureev Did you see our ChakraCore samples? https://github.com/Microsoft/Chakra-Samples/tree/master/ChakraCore%20Samples/Hello%20World

Comparing to that what do you do different?

@Kureev
Copy link
Author

Kureev commented Sep 2, 2016

@obastemur I'm actually trying to run Hello World example from the OS X application. I'm using ObjectiveC++ to run it. It compiles without errors (in XCode), but after that nothing happens (expected behavior - I see Hello World in the console). I can share my git repo if needed

@Kureev
Copy link
Author

Kureev commented Sep 5, 2016

Will it help if I share my XCode example?

P.S. I suspect it fails when I try to create a JS runtime (if I remove code below this line (inclusive), it works). Will be nice if you can point me to the right direction and I debug it by myself.

@obastemur
Copy link
Collaborator

(if I remove code below this line (inclusive), it works

?

Will it help if I share my XCode example?

Sure

@Kureev
Copy link
Author

Kureev commented Sep 5, 2016

I mean if I remove everything below JsCreateRuntime(incl) from HelloWorld example - everything works.

Here's my research project: https://github.com/Kureev/GoldenGate

P.S. Thanks for the fast feedback, really appreciate it ❤️

@obastemur
Copy link
Collaborator

@Kureev it is all about the order of the libs. See updated project file at https://gist.github.com/obastemur/73bec7c23e02aeba67200f4c1cd2cad9

I was able to see Hello World on the console.

sscc

@obastemur
Copy link
Collaborator

Closing for now. Thanks for bringing it up.

@Kureev
Copy link
Author

Kureev commented Sep 5, 2016

Indeed, reordering libraries helped!

Thank you for your time and assistance.
I know, it's a bit a side track, but could you be so kind to explain why dependency order matters?

@obastemur
Copy link
Collaborator

why dependency order matters?

a - Library X depends on Library Y. [ Y->X ]
b - Library X depends on Library Z too. (Y shares an interface with Z that we override) [Z->Y->X]

Failing on (a) may produce a linker error (see below), failing on (b) may produce an undefined runtime behavior.

IIRC VS linker does pretty decent job. GCC et. all depends on the order I've just mentioned previously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants