Skip to content

Emscripten build issues and build instructions #777

Closed
@rendaw

Description

First of all, AFAICT from git history the project switched from a handmade Makefile to CMake recently and it looks like the build instructions on the wiki are out of date.

I'm trying to build the WASM version, I use these commands:

emcmake cmake . && emmake make

but linking tic80.js fails with:

[ 85%] Linking CXX executable bin/tic80.js
/usr/bin/cmake -E cmake_link_script CMakeFiles/tic80.dir/link.txt --verbose=1
/usr/lib/emscripten/em++     @CMakeFiles/tic80.dir/objects1.rsp  -o bin/tic80.js @CMakeFiles/tic80.dir/linklibs.rsp
warning: unexpected number of arguments 1 in call to 'getClipboardEvent', should be 0
error: undefined symbol: SDL_BuildAudioCVT
warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0`
error: undefined symbol: SDL_CloseAudioDevice
error: undefined symbol: SDL_ConvertAudio
error: undefined symbol: SDL_CreateSystemCursor
error: undefined symbol: SDL_CreateWindow
error: undefined symbol: SDL_GL_CreateContext
error: undefined symbol: SDL_GL_GetDrawableSize
error: undefined symbol: SDL_GetClipboardText
error: undefined symbol: SDL_GetColorKey
error: undefined symbol: SDL_GetPerformanceCounter
error: undefined symbol: SDL_GetPerformanceFrequency
error: undefined symbol: SDL_GetWindowFromID
error: undefined symbol: SDL_GetWindowID
error: undefined symbol: SDL_HasClipboardText
error: undefined symbol: SDL_JoystickGetAttached
error: undefined symbol: SDL_OpenAudioDevice
error: undefined symbol: SDL_PauseAudioDevice
error: undefined symbol: SDL_QueueAudio
error: undefined symbol: SDL_SetClipboardText
error: undefined symbol: SDL_SetCursor
error: undefined symbol: SDL_SetHint
error: undefined symbol: SDL_SetWindowIcon
error: undefined symbol: SDL_SetWindowSize
error: undefined symbol: SDL_ShowSimpleMessageBox
error: undefined symbol: SDL_memcpy
error: undefined symbol: glColor4f
error: undefined symbol: glColor4ub
error: undefined symbol: glEnd
error: undefined symbol: glGetTexImage
error: undefined symbol: glGetTexLevelParameteriv
error: undefined symbol: glLoadMatrixf
error: undefined symbol: glTexCoord2f
error: undefined symbol: glVertex3f
error: undefined symbol: glXGetClientString
error: undefined symbol: glXGetProcAddressARB
error: undefined symbol: glXQueryVersion
Error: Aborting compilation due to previous errors
ERROR:root:'/usr/bin/node /usr/lib/emscripten/src/compiler.js /tmp/tmpr74l339j.txt /usr/lib/emscripten/src/library_pthread_stub.js' failed (1)
$ cat CMakeFiles/tic80.dir/objects1.rsp 
CMakeFiles/tic80.dir/src/net.c.o CMakeFiles/tic80.dir/src/system.c.o CMakeFiles/tic80.dir/src/ext/file_dialog.c.o
$ cat CMakeFiles/tic80.dir/linklibs.rsp 
lib/libtic80lib.a lib/libsdlnet.a lib/libsdlgpu.a lib/libtic80core.a lib/liblua.a lib/liblpeg.a lib/libwren.a lib/libsquirrel.a lib/libgiflib.a lib/libzlib.a

I can't say I'm familiar with emscripten and I've made about a million mistakes getting this far so it's possible I missed something. I thought the SDL_ ones at least would have been built by 3rd-party/sdl-gpu... I see that compiled into a .a file earlier in the log.

Glad to update the wiki if someone can help me get this working.

Linux
cmake 3.12.4
emcc 1.38.15

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions