oprypin / crsfml

Crystal bindings to SFML multimedia/game library

Home Page:https://oprypin.github.io/crsfml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Weird warning with SFML 2.5.1 on arch linux

vypxl opened this issue · comments

I installed sfml 2.5.1 via pacman and built crsfml from source.

When I run anything, my program prints
Warning: CrSFML was built for SFML 2.5.1, found SFML 2.5.0 to STDERR 5 times.

I rebuilt crsfml and reinstalled sfml several times.

I do not think that I have another sfml installation anywhere...

Where does it come from?

Maybe you had previously (globally) make installed VoidCSFML?

Nope, cannot find them in /usr/include or /usr/lib. Also the last time I updated my libs was at sfml 2.4.2 haha

It would be /usr/local/lib

Nothing in there

Well, this warning tells in no uncertain terms that VoidCSFML was built at a time when SFML's header files specified version 2.5.0.

If you compile my_program.cr, you can then run ldd ./my_program to find out which path it picks up voidcsfml from. Then you can ensure that the lib at that path is not outdated. Could even be that cmake refuses to (re)build it due to caching.

It uses the locally built voidcsfml. I even deleted everything and reinstalled it and the warning persists.

Well that does not appear possible to me :(

The only thing that would help here (other than me actually working from your computer)
is for you to specify the exact commands and outputs that you're seeing

We can try another sanity check on the lib file:

python -c "from ctypes import CDLL, c_int, byref, RTLD_GLOBAL; CDLL('libsfml-system.so', mode=RTLD_GLOBAL); lib = CDLL('voidcsfml/libvoidcsfml-system.so', mode=RTLD_GLOBAL); a, b, c = c_int(), c_int(), c_int(); lib.sfml_system_version(byref(a), byref(b), byref(c)); print(a.value, b.value, c.value)"

(or the same as a proper program:)

#!/usr/bin/env python
from ctypes import CDLL, c_int, byref, RTLD_GLOBAL

CDLL('libsfml-system.so', mode=RTLD_GLOBAL)
lib = CDLL('voidcsfml/libvoidcsfml-system.so', mode=RTLD_GLOBAL)

a, b, c = c_int(), c_int(), c_int()
lib.sfml_system_version(byref(a), byref(b), byref(c))
print(a.value, b.value, c.value)

The other part of the sanity check would be to compile a C++ program to check SFML itself

#include <stdio.h>
#include <SFML/System.hpp>

int main() {
    printf("%d.%d.%d\n", SFML_VERSION_MAJOR, SFML_VERSION_MINOR, SFML_VERSION_PATCH);
    return 0;
}

Ok I solved it, the issue was that my script which should have set up the LIBRARY_PATH accessed a very, very old version of my project in a backup folder...

Still strange that it reported 2.5.0 because it should have been 2.4.2..

Thanks for your help!