Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sMEMORY64 build fails with UTF8ToString expects a number error #16

Open
githubuser6000 opened this issue Feb 2, 2025 · 4 comments
Open

Comments

@githubuser6000
Copy link

I am trying to build in "64-bit mode", so added -sMEMORY64 to my project (both compile and link flags), and manually edited a local copy of emscripten-glfw to add these flags to its build. Everything builds fine. I load it up in the browser with a python -m http.server, I get this

Image

Image

Related discussion

@ypujante
Copy link
Member

ypujante commented Feb 3, 2025

I am not familiar with this flag. I will have to investigate. Thanks for reporting.

Out of curiosity, did you try using the GLFW3 that is part of Emscripten (-sUSE_GLFW=3) instead of this library? Which feature(s) do you need from this port vs the one in Emscripten?

@githubuser6000
Copy link
Author

No I haven't tried the built-in glfw3.

Which feature(s) do you need from this port vs the one in Emscripten?

Mainly multi-window, clipboard, gamepad, and window size constraints. It's just experimentation for now tho, nothing production critical.

Thank you for taking a look! And thank you for this port 🙌!

@ypujante
Copy link
Member

ypujante commented Feb 3, 2025

I pushed a branch which adds the function signatures as Sam described.

I have simply done a cursory test to make sure it doesn't break the normal case but I did not test memory64 (as I ran out of time), but wanted to give you a chance to try it on your side to see if that fixes your issue.

I will test it more thoroughly when I have time in the next few days.

@githubuser6000
Copy link
Author

githubuser6000 commented Feb 4, 2025

That seems to have worked, thank you!

I had to update the cmake file

--- target_compile_options(glfw3_pthread PUBLIC "-pthread")
+++ target_compile_options(glfw3_pthread PUBLIC "-pthread;-sMEMORY64") 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants