stanoddly / DotnetRaylibWasm

Prototype for .NET 7 with Raylib compiled into WebAssembly (wasm)
MIT License
61 stars 8 forks source link

Release build doesn't work, it's missing _glfwSetErrorCallback #6

Closed stanoddly closed 1 year ago

stanoddly commented 1 year ago

Apparently some optimization happens for the release build, because when executed it fails with:

dotnet.js:14 missing function: glfwSetErrorCallback
_glfwSetErrorCallback @ dotnet.js:14
dotnet.js:14 Aborted(-1)
abort @ dotnet.js:14
dotnet.js:5 RuntimeError: Aborted(-1). Build with -sASSERTIONS for more info.
    at abort (:63048/dotnet.js:14:13320)
    at _glfwSetErrorCallback (:63048/dotnet.js:14:211801)
    at :63048/dotnet.wasm
    at :63048/dotnet.wasm
    at :63048/dotnet.wasm
    at :63048/dotnet.wasm
    at :63048/dotnet.wasm
    at :63048/dotnet.wasm
    at :63048/dotnet.wasm
    at :63048/dotnet.wasm
Ce @ dotnet.js:5
localhost/:1 Uncaught RuntimeError: Aborted(-1). Build with -sASSERTIONS for more info.
    at abort (dotnet.js:14:13320)
    at _glfwSetErrorCallback (dotnet.js:14:211801)
    at dotnet.wasm:0x2dd9b
    at dotnet.wasm:0x829c3
    at dotnet.wasm:0x81e8e
    at dotnet.wasm:0x7359a
    at dotnet.wasm:0x7244c
    at dotnet.wasm:0x1f9fac
    at dotnet.wasm:0xddc75
    at dotnet.wasm:0xddbeb
stanoddly commented 1 year ago

It's because for whatever reason the Debug build works just fine, but Release requires EmccExtraLDFlags to be used:

    <EmccExtraLDFlags>-s USE_GLFW=3</EmccExtraLDFlags>

Anyway this is fixed.