Closed 8Observer8 closed 9 months ago
This is an issue with Emscripten rather than with this sample. Possible fixes:
tot
instead of latest
, as emscripten_webgl_get_proc_address
has been recently defaulted to enabled: https://github.com/emscripten-core/emscripten/commit/639e81720bab69aaaee5984563fb36960d6e88e0. This is demonstrated working here: https://github.com/Ravbug/sdl3-sample/actions/runs/7353720055/job/20020048005CMakeLists.txt
to define -sGL_ENABLE_GET_PROC_ADDRESS
as a linker flag, as per the error messagetot
becomes mainline. Then latest
should work correctly. Do you mean this CMakeLists.txt in the sdl3-sample
directory?
define -sGL_ENABLE_GET_PROC_ADDRESS as a linker flag
I am not familiar with CMake. How to add this frag correctly? In what section?
Why should I add the -sGL_ENABLE_GET_PROC_ADDRESS
flag? It works without it!
I installed the emsdk 3.1.37
version. The build process ended without errors:
I renamed the sdl-min.html
to index.html
and ran this command: http-server -c-1
inside of the build/web
directory. I opened this url: http://localhost:8080/index.html
and it works:
I have written a step by step guide: How to run SDL3 app on Web with WebAssembly on Windows
This is my topic on the SDL forum: https://discourse.libsdl.org/t/how-to-build-a-sdl3-application-to-webassembly/48041
I use this manual to build:
Note 1. I used
cmake -G "MinGW Makefiles" ..
insttead ofcmake ..
Note 2. This manual works for Android. Except "Ninja" app that must be installed (and added to Path, I used one from Qt:
C:\Qt\Tools\Ninja
) and manually changing of CMake version in thebuild.gradle
script.I installed the latest
emsdk
for the current time:I completed this task:
This is the result:
The next task is:
But the
build
directory looks like this:This is the
/build/web
directory:I have the
http-server
package to run the result but I don't see the index.html. What to do next? You should add the next step.I ran the
mingw32-make
command inside of thebuild/web
directory:Only the
sdl-min.wasm
was generated but I didn't find thesdl-min.html
file. I don't understand what the errors mean and how to solve them.