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

Working for Web page - library name change #4692

Closed
MikiZX1 opened this issue Jan 16, 2025 · 1 comment
Closed

Working for Web page - library name change #4692

MikiZX1 opened this issue Jan 16, 2025 · 1 comment

Comments

@MikiZX1
Copy link
Contributor

MikiZX1 commented Jan 16, 2025

Problem description:
downloading a fresh copy of raylib repo from Github and compiling for Web, following wiki page(https://github.com/raysan5/raylib/wiki/Working-for-Web-(HTML5)), produces web version of the raylib library that is named incorrectly.
the wiki page was accurate until de6c09e change was made to raylib.

Steps to reproduce:
-download raylib from Github
-compile for WEB following instruction provided on Wiki (https://github.com/raysan5/raylib/wiki/Working-for-Web-(HTML5)) by running these commands in the 'src' folder:
emcc -c rcore.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
emcc -c rshapes.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
emcc -c rtextures.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
emcc -c rtext.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
emcc -c rmodels.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
emcc -c utils.c -Os -Wall -DPLATFORM_WEB
emcc -c raudio.c -Os -Wall -DPLATFORM_WEB

emar rcs libraylib.a rcore.o rshapes.o rtextures.o rtext.o rmodels.o utils.o raudio.o

-enter the examples folder and build the examples
you can build the examples either by:
1) modifying 'Makefile' in the examples folder to build for PLATFORM_WEB by modifying line 57 from
PLATFORM ?= PLATFORM_DESKTOP
to
PLATFORM ?= PLATFORM_WEB
- and then run 'make' in examples folder

-or, at your convenience, by:
2) running : make PLATFORM=PLATFORM_WEB -B in the examples folder.

this produces the 'library name' error :
emmake make -f Makefile.Web core/core_2d_camera
make: make -f Makefile.Web core/core_2d_camera
make[1]: Entering directory '/home/linuxmin/Downloads/test_raylib/examples'
emcc -o core/core_2d_camera.html core/core_2d_camera.c -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces -Wunused-result -O3 -I. -I../src -I../src/external -L. -L../src -L../src -sTOTAL_MEMORY=134217728 -sFORCE_FILESYSTEM=1 -sEXPORTED_RUNTIME_METHODS=ccall -sMINIFY_HTML=0 -sUSE_GLFW=3 -sASYNCIFY --shell-file ../src/shell.html ../src/libraylib.web.a -DPLATFORM_WEB
emcc: error: ../src/libraylib.web.a: No such file or directory ("../src/libraylib.web.a" was expected to be an input file, based on the commandline arguments provided)
make[1]: *** [Makefile.Web:565: core/core_2d_camera] Error 1
make[1]: Leaving directory '/home/linuxmin/Downloads/test_raylib/examples'
emmake: error: 'make -f Makefile.Web core/core_2d_camera' failed (returned 2)
make: *** [Makefile:694: core/core_2d_camera] Error 1```

Possible solution:
Change wiki page (link: https://github.com/raysan5/raylib/wiki/Working-for-Web-(HTML5)#2-compile-raylib-library) to read:

emcc -c rcore.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
emcc -c rshapes.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
emcc -c rtextures.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
emcc -c rtext.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
emcc -c rmodels.c -Os -Wall -DPLATFORM_WEB -DGRAPHICS_API_OPENGL_ES2
emcc -c utils.c -Os -Wall -DPLATFORM_WEB
emcc -c raudio.c -Os -Wall -DPLATFORM_WEB

emar rcs libraylib.web.a rcore.o rshapes.o rtextures.o rtext.o rmodels.o utils.o raudio.o

@raysan5
Copy link
Owner

raysan5 commented Jan 16, 2025

@MikiZX1 feel free to review the Wiki info! thanks!

@raysan5 raysan5 closed this as completed Jan 16, 2025
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