raylib-game-template
raylib-game-template copied to clipboard
Getting linker error with cmake
Getting the following linker error when building with cmake: (pruned for readability)
...
wasm-ld: error: _deps/raylib-build/raylib/libraylib.a(rcore.c.o): undefined symbol: glfwGetTime
wasm-ld: error: _deps/raylib-build/raylib/libraylib.a(rcore.c.o): undefined symbol: glfwSwapBuffers
wasm-ld: error: _deps/raylib-build/raylib/libraylib.a(rcore.c.o): undefined symbol: glfwSetErrorCallback
wasm-ld: error: _deps/raylib-build/raylib/libraylib.a(rcore.c.o): undefined symbol: glfwInit
wasm-ld: error: _deps/raylib-build/raylib/libraylib.a(rcore.c.o): undefined symbol: glfwDefaultWindowHints
wasm-ld: error: _deps/raylib-build/raylib/libraylib.a(rcore.c.o): undefined symbol: glfwWindowHint
...
Adding the following after line 44 fixed the issue:
target_link_options(${PROJECT_NAME} PUBLIC "-sUSE_GLFW=3")
@mrdaybird feel free to send a PR with the review!