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

raylib5.c3l failing to link with glfw3 #29

Open
Book-reader opened this issue Oct 13, 2024 · 4 comments · May be fixed by #30
Open

raylib5.c3l failing to link with glfw3 #29

Book-reader opened this issue Oct 13, 2024 · 4 comments · May be fixed by #30

Comments

@Book-reader
Copy link

Book-reader commented Oct 13, 2024

on arch, fedora, and debian linux, glfw3 is linked with using -lglfw instead of -lglfw3.
this causes raylib5.c3l and raylib.c3l to fail to build with the message /usr/bin/ld: cannot find -lglfw3: No such file or directory.
it can be fixed by replacing "linked-libraries" : [ "glfw3" ] with "linked-libraries" : [ "glfw" ]

@lerno
Copy link
Contributor

lerno commented Oct 13, 2024

Ok, from what I see on the Raylib site, glfw3 is the correct one. Unless glfw works on ALL Linux distros, some other solution must be found.

@Book-reader
Copy link
Author

after more testing,
method: install gcc and glfw3 (libglfw3-dev, glfw-devel, etc) in a distrobox container, then run a raylib hello world that uses the library, but use either glfw or glfw3 in the manifest.json of raylib5.c3l
work means the program ran
fail means the compilation failed with the error /usr/bin/ld: cannot find -lglfw3: No such file or directory

Distro glfw glfw3
Arch work fail
Fedora 40 work fail
Debian 12 work fail
Ubuntu 24.04 work fail
OpenSUSE Tumbleweed work fail

also glfw.c3l uses "linked-libraries" : [ "glfw" ]

running pkg-config --libs glfw3 also returns -lglfw

@Book-reader
Copy link
Author

To clarify my incoherent ramblings, I belive that -lglfw is the correct way to link with glfw3, when installed using a system package manager as can be seen in the raylib makefile:

# Check the version name. If GLFW3 was built manually, it may have produced
# a static library known as libglfw3.a. In that case, the name should be -lglfw3
LDLIBS = -lglfw

@Book-reader
Copy link
Author

And because, as far as I am aware, on linux "linked-libraries": ["glfw3"] is directly converted to -lglfw3, which does not work when glfw3 is installed using the system package manager. Instead "linked-libraries": ["glfw"] would be needed

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

Successfully merging a pull request may close this issue.

2 participants