2

I'm trying to compile raylib for html5, but I can't seem to run make properly. Running make PLATFORM=PLATFORM_WEB -B in raylib/src returns this:

emcc -c rcore.c -Wall -D_DEFAULT_SOURCE -Wno-missing-braces -Werror=pointer-arith -fno-strict-aliasing -std=gnu99 -Os -I. -Iexternal/glfw/include -Iexternal/glfw/deps/mingw -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
make: emcc: Command not found
make: *** [Makefile:558: rcore.o] Error 127

However, running emcc works fine in the current shell (prints no input files), sh and bash, and works in different terminal emulators. $PATH is (from zsh and alacritty, my primary shell and terminal emulator):

/home/user/emsdk:/home/user/emsdk/upstream/emscripten:/home/user/emsdk/node/14.15.5_64bit/bin:/opt/devkitpro/tools/bin:/home/user/.local/bin:/home/user/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9
  • is it still relevant? Commented Jan 5, 2022 at 0:38
  • @AlexBender I figured out that part of the problem has something to do with the makefile, but after messing with it and not getting very far, I gave up Commented Jan 5, 2022 at 6:37
  • would you like to try again? there is a great Discord server managed by ray, the creator of raylib. Give it a shot, this world is fascinating! Commented Jan 5, 2022 at 10:22
  • @AlexBender maybe some other time, I did end up asking there a while ago but got no response Commented Jan 6, 2022 at 9:11
  • sorry to hear that. At least the readme describes what to do, I was able to get emscripten and build some examples Commented Jan 6, 2022 at 13:06

1 Answer 1

2

Despite the fact that emsdk is installed, following current (as at 8 Jan '22) documentation will not result in working examples. Build would be failed.

In order to build it on Ubuntu with make --version GNU Make 4.2.1 you need to provide -e option to pass environment variables to make

Then, after build is finished -- start python http server in examples directory and navigate to that address in browser: python3 -m http.server 9999 open http://localhost:9999 and select desired example.

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

1 Comment

I'm going to file an issue on the official Github repo for this to be added to the documentation. I'll link back to here for credit. Thanks for this.

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.