Hiya, I'm trying to compile a fairly large OpenGL program with emscripten, and surprisingly, I'm only getting a very few warnings and 1 unresolved external, (em++) I've defined GLFW_INCLUDE_ES3 before including glfw. Everything seems ok, except that the unresolved symbol is quite worrying: "glfwCreateWindow"
I've tried searching on the net about others having similar issues but no luck. "glfwCreateWindow" to the best of my knowledge is supported in GL_ES, it's a standard glfw function that otherwise works on a PC build. What might I be missing here? I'm sure if I messed something up there should be lots of errors and probably a lot more unresolved symbols.
By the way, I really like the idea of emscripten! Hope to get it working soon :) Keep up the good work, and thanks for the help in advance
Try passing -s USE_GLFW=3 to em++, by it's set to GLFW 2 by default.
Thanks, that did solve the unresolved symbol issue! :) My code compiles and runs but something is up with the file management, for some reason only "_embedding_" works, "_preloading_" seems to not find the file
Failed to load file:///C:/Users/Mat/Desktop/emsdk-portable-64bit/index.data: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
Both --embed & --preload create the exact same DATA file, at the same location.
I'm using: em++ main.cpp -o index.html --preload-file config.txt
Latest emscripten version. Thanks again for taking the time to help me, I've looked around and only found a few posts online where people were discussing --preload but others mostly seemed to have had problems with using relative paths including "../" or ".".
Thank you again!
[EDIT]
I know this is a different issue but I didn't want to open a new discussion, I hope it's ok. Thanks
The only thing I can think of is you may be trying to run from the filesystem. Emscripten needs XHR to load the preload file (among others) which won't work if you're not loading from a web server (even if it's just a local one)
I see! I've just tried this on a web server, and preload worked as expected. I see now. I'll need to find a workaround for this so I can test locally. Thanks!
Use --memory-init-file 0 to test locally on chrome, or just use firefox
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.
Most helpful comment
Try passing
-s USE_GLFW=3toem++, by it's set to GLFW 2 by default.