0

I have to include multiple libraries for a project - I've already succeeded in including multiple emscripten libraries but I cannot seem to access the preloaded MEMFS filesystem in the 2nd one.

In the second library I use the

--embed-file 

parameter in the linker to embed a whole directory with the JS file output but when I access the files in the web console via

FS.stat()

I cannot access any file that was embedded.

Has anyone faced the same issue?

1 Answer 1

0

I initially had a similar behaviour. It turned out to be the "file" part of it that every browser would treat differently.

If your are running your page from a server, then this is not the case.

Otherwise have a look at : https://kripken.github.io/emscripten-site/docs/getting_started/Tutorial.html#tutorial-files

Unfortunately Chrome and Internet Explorer do not support file:// XHR requests, and can’t directly load the local file in which preloaded data is stored. For these browsers you’ll need to serve the files using a webserver. The easiest way to do this is to use the python SimpleHTTPServer (in the current directory do python -m SimpleHTTPServer 8080 and then open http://localhost:8080/hello.html).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.