janet-lang / jaylib

Janet bindings to Raylib
MIT License
146 stars 37 forks source link

GLFW: Error: 65544 Description: X11: Failed to load Xlib #36

Closed CFiggers closed 2 years ago

CFiggers commented 2 years ago

Platform

Ubuntu 22.04 on Windows Subsystem for Linux (WSL2)

Steps to reproduce:

  1. gh repo clone janet-lang/jaylib -- --recurse-submodules
  2. cd jaylib
  3. jpm build
  4. jpm test

Expected results:

Tests pass.

Actual results:

$ jpm test
running test/collision.janet ...
running test/test0.janet ...
INFO: Initializing raylib 4.0
WARNING: GLFW: Error: 65544 Description: X11: Failed to load Xlib
non-zero exit code in test/test0.janet: 139
running test/test1.janet ...
info: Initializing raylib 4.0
warning: GLFW: Error: 65544 Description: X11: Failed to load Xlib
non-zero exit code in test/test1.janet: 139
running test/test2.janet ...
INFO: Initializing raylib 4.0
WARNING: GLFW: Error: 65544 Description: X11: Failed to load Xlib
non-zero exit code in test/test2.janet: 139
running test/test3.janet ...
INFO: Initializing raylib 4.0
WARNING: GLFW: Error: 65544 Description: X11: Failed to load Xlib
non-zero exit code in test/test3.janet: 139
running test/test4.janet ...
INFO: Initializing raylib 4.0
WARNING: GLFW: Error: 65544 Description: X11: Failed to load Xlib
non-zero exit code in test/test4.janet: 139
running test/test5.janet ...
INFO: Initializing raylib 4.0
WARNING: GLFW: Error: 65544 Description: X11: Failed to load Xlib
non-zero exit code in test/test5.janet: 139
Failing test scripts: 6

Attempted troubleshooting/diagnosis:

Building raylib independent of jaylib

Building raylib itself works just fine:

  1. cd raylib/src
  2. make
  3. cd ../examples
  4. make core
  5. cd core
  6. core_basic_window => window appears correctly

Locating source of error message

Error seems to be triggered by the GLFW embedded in raylib submodule:

image

libX11.so.6 confirmed present on system:

image

Adjusting compiler flags in project.janet

Tried adding "-static" flag to lflags in project.janet. Results in these errors during jpm build:

[...]
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object
/usr/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
[...]
error: command failed with non-zero exit code 1
creating static library build/jaylib.a...
error: build fail
  in pdag [/usr/local/lib/janet/jpm/dagbuild.janet] (tailcall) on line 79, column 23
  in run-main [boot.janet] on line 3783, column 16
  in cli-main [boot.janet] on line 3928, column 17
CFiggers commented 2 years ago

"Have you tried turning it off and back on again?"

Tried setting up from scratch in a completely fresh install of Ubuntu 22.04 aaaand.... it works? No idea what was broken, but it's fine now apparently!

PEBKAC, possibly.