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
Compiling a binary with glfw-rs rlib fails #77
Comments
Oh, and I am on Linux 64-bit. |
You might want to pop onto #rust-gamedev on the Mozilla IRC it might be quicker to help you there. |
It's not too much of a concern, as I can use shared libraries for now. |
Maybe this is part of the same issue as #75? |
Hm, does using pkg-config to link to the libraries directly while calling rustc work? I need to get around to documenting this sorry. |
I'm experiencing this very issue (on Ubuntu 13.10). @HeroesGrave and others: how does your temporary workaround work? I've been trying to compile glfw-rs the recommended way with CMake and |
Go into src/glfw/lib.rs, and add Then run |
Thanks! I added that line, but glfw-rs still didn't build, with the linker complaining that my static GLFW library couldn't be used and suggesting to "recompile with -fPIC". The solution required adding the C compiler flag I'm not exactly sure why this caused everything to work, since my knowledge of C compiling/linking is very poor. But this solved the problem for me; hopefully this is useful information for @bjz or other contributors of this library in making the build procedure easier for future users. |
Hmm interesting. Might have to ask @metajack so enlighten us. It would be cool to have a CMake option to build either a static or dynamic library (as glfw itself does). |
I tried again to make sure there was no derp on my behalf, and the result was exactly the same. Maybe you should make it compile to both static and dynamic. That would somewhat solve this without breaking it on windows. |
I'm currently working on regigging the build script - CMake is a big pain, but it seems like the best we have, unfortunately. Sorry for the wait on this. |
Well it seems that this is more-or-less fixed. |
I am using glfw-rs for 2 projects.
The first is a library, and that compiles fine.
However, when I try to use it in a binary, it gives me this error:
When I recompile glfw-rs as a dynamic library, and try again, it works fine.
I suspect this is a linking problem, and you can't really fix it, but if that is the case, do you at least know of a workaround so I can use glfw-rs as a rlib?
The text was updated successfully, but these errors were encountered: