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

Cannot build tests on linux with static GLFW #128

Closed
iacore opened this issue Dec 2, 2022 · 3 comments
Closed

Cannot build tests on linux with static GLFW #128

iacore opened this issue Dec 2, 2022 · 3 comments
Assignees
Labels

Comments

@iacore
Copy link

iacore commented Dec 2, 2022

I installed GLFW3 from source, at it installs as static library by default.

How to link it properly:

  • use pkgconf --static --libs glfw3
  • add -lX11 after each -lm in build.ninja (better to do it in CMakeLists.txt)
@jpbruyere jpbruyere self-assigned this Dec 2, 2022
@jpbruyere jpbruyere added the bug label Dec 2, 2022
@jpbruyere
Copy link
Owner

static glfw should already have platform libs linkage. If you compile glfw from source, maybe try add_directory(glfw_src_path) in cmake, that's the preferred way to include it to client project.

@iacore
Copy link
Author

iacore commented Dec 3, 2022

CMake generated the build files for Njna.
ninja -v invokes gcc, which is not linking with -lX11.

This is about building the included tests, not some other project.

@iacore iacore changed the title Cannot build on linux with static GLFW Cannot build tests on linux with static GLFW Dec 3, 2022
@jpbruyere
Copy link
Owner

I've tested linking against a static glfw, with makefiles and ninja, and I got no problem. I'm on Debian testing, maybe give details on your platform, if I have time, I will test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants