Open claudeha opened 3 years ago
Never mind, I just needed to link all the other .a
files found in other directories. Would be nice if there was a single .a
result combining all of them though!
claude@latte:~/code/github.com/claudeha/libpd/samples/emscripten/gemtest$ make
emcc -I../../..//pure-data/src -I../../..//libpd_wrapper -O3 -o gemtest.html gemtest.c \
-s USE_SDL=2 \
-s LEGACY_GL_EMULATION=1 \
-s ERROR_ON_UNDEFINED_SYMBOLS=0 \
--preload-file test.pd \
--preload-file Gem \
-L../../..//build/libs -lpd ../../../../Gem//src/Pixes/.libs/libPixes.a ../../../../Gem//src/Gem/.libs/libGem.a ../../../../Gem//src/Nongeos/.libs/libNongeos.a ../../../../Gem//src/Controls/.libs/libControls.a ../../../../Gem//src/Particles/.libs/libParticles.a ../../../../Gem//src/Particles/.libs/libPAPI.a ../../../../Gem//src/openGL/.libs/libopenGL.a ../../../../Gem//src/Manips/.libs/libManips.a ../../../../Gem//src/Geos/.libs/libGeos.a ../../../../Gem//src/plugins/.libs/libplugins.a ../../../../Gem//src/Base/.libs/libBase.a ../../../../Gem//src/Utils/.libs/libUtils.a ../../../../Gem//src/RTE/.libs/libRTE.a ../../../../glu//.libs/libGLU.a
warning: undefined symbol: glColorMaterial (referenced by top-level compiled C/C++ code)
warning: undefined symbol: glLightModeli (referenced by top-level compiled C/C++ code)
warning: metadce: missing declaration for emcc$export$dynCall_vi
claude@latte:~/code/github.com/claudeha/libpd/samples/emscripten/gemtest$
Oh, it needs more -Wl,--whole-archive
to actually include the code that defines the Pd objects in static constructors otherwise it isn't linked at all, and then the list of missing gl
symbols is a mile long. Also need not to link libPAPI.a
as it is already included in libParticles.a
.
i cannot test right now, but PRs are always welcome ;-)
With Gem (not my older patched version, rather current upstream) built with Emscripten like this:
there seem to be symbols missing from the
libGem.a
, which breaks the final link:and indeed the generated HTML+JS+WASM fails at runtime after printing
GEM: Graphics Environment for Multimedia
: