microsoft / Chakra-Samples

Repository for Chakra JavaScript engine related samples.
MIT License
216 stars 84 forks source link

Unable to run the sample app in Linux #81

Closed DiegoBM closed 7 years ago

DiegoBM commented 7 years ago

Hi all

After successfully building a release version of ChrakraCore in Ubuntu Linux with ./build.sh and cloning and building the sample app in "CrossPlatform" folder I received 2 errors, one of which I could solve, but I'm stuck on the second. The first error seems to be related to the JsCopyString function signature. I was getting this:

sample.cpp:61:79: error: too many arguments to function ‘JsErrorCode JsCopyString(JsValueRef, char, size_t, size_t)’ FAIL_CHECK(JsCopyString(resultJSString, nullptr, 0, nullptr, &stringLength));

Once I fixed the function calls to use only 4 parameters the project built successfully, but now when I try to run with ./sample.o I get the following error:

./sample.o: error while loading shared libraries: libChakraCore.so: cannot open shared object file: No such file or directory

I have checked that the library certainly is in ../out/Release/libChakraCore.so, so not really sure why it cannot find the library. Any help would be appreciated.

Thank you in advance

Kind regards

Diego de Blas

liminzhu commented 7 years ago

Thanks for opening the issue and sorry to get to you late @DiegoBM !

JsCopyString - we changed its signature a few weeks ago. I will change the samples accordingly. Cannot find .so - any chance you build sample.o with make BUILD_TYPE=Debug instead of release?

DiegoBM commented 7 years ago

Thank you for replying @liminzhu, it turns out I was not installing the library in /use/lib which seems to be a requirement for Linux systems, after doing that all worked as expected

liminzhu commented 7 years ago

Gotcha. I just have the samples updated as well. Close the issue now but feel free to reopen if you have more questions.

DiegoBM commented 7 years ago

All good on my side, thank you again :)