SFML community forums

Bindings - other languages => Python => Topic started by: maggintosh on May 21, 2014, 04:41:00 pm

Title: [Mac] PySFML - Install Error 'SFML/System.hpp' file not found
Post by: maggintosh on May 21, 2014, 04:41:00 pm
Hi guys,
i tried to install python-sfml 1.3 in terminal with "python setup.py install" on my MacBook running Mavericks but im getting this error:

Quote
[...]
building 'sfml.system' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -Iinclude -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/sfml/system.cpp -o build/temp.macosx-10.9-intel-2.7/src/sfml/system.o -fpermissive
src/sfml/system.cpp:350:10: fatal error: 'SFML/System.hpp' file not found
#include "SFML/System.hpp"
             ยด`
1 error generated.
[...]

I've already installed SFML 2.1 and Cython 0.20.1.

So i checked the usr/local/include/SFML path but all the headers are in place. No idea how to solve that problem. Hope anyone can help  :)
Title: Re: [Mac] PySFML - Install Error 'SFML/System.hpp' file not found
Post by: Hiura on May 21, 2014, 04:52:07 pm
I've never used PySFML so here is a guess in the wild: try to edit the command line to add

-I /usr/local/include

or something similar. Maybe the compiler was not told to look there.
Title: Re: [Mac] PySFML - Install Error 'SFML/System.hpp' file not found
Post by: maggintosh on May 21, 2014, 05:57:16 pm
Don't know how to edit the command line  :-[ Unknown command

Sorry, i am pretty unexperienced, just beginning...
Title: Re: [Mac] PySFML - Install Error 'SFML/System.hpp' file not found
Post by: Hiura on May 21, 2014, 06:32:59 pm
Maybe try another python binding. From http://www.sfml-dev.org/download/bindings.php you can find http://www.python-sfml.org/download.html.
Title: Re: [Mac] PySFML - Install Error 'SFML/System.hpp' file not found
Post by: maggintosh on May 21, 2014, 11:09:28 pm
python-sfml 1.3 is the one i tried out first and i got the same problem installing pysfml-cython, which is another python binding. Same error here:

Quote
src/sfml.cpp:353:10: fatal error: 'SFML/Graphics.hpp' file not found
#include "SFML/Graphics.hpp"

I even tried to install python bindings together with SFML 2.0, because i read that PySFML 1.3 is written for SFML 2.0, but that didn't work either  :-\

Hm, could it be the wrong cython version? Maybe i need to install cython 0.19?
Title: Re: [Mac] PySFML - Install Error 'SFML/System.hpp' file not found
Post by: maggintosh on May 21, 2014, 11:28:32 pm
UPDATE:

Now i tried
Quote
python setup.py build_ext --include-dirs=usr/local/include/

but i got a whole bunch of warnings and a new fatal error:

Quote
ld: library not found for -lsfml-graphics
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'c++' failed with exit status 1
Title: Re: [Mac] PySFML - Install Error 'SFML/System.hpp' file not found
Post by: Hiura on May 21, 2014, 11:56:33 pm
Maybe there's a lib-dirs option? Usually binaries are in /usr/local/lib.

Try to contact the author of the binding(s) if you're still stuck; maybe they can help you.
Title: Re: [Mac] PySFML - Install Error 'SFML/System.hpp' file not found
Post by: maggintosh on May 22, 2014, 12:31:57 am
Well, as far as i can tell, all the files are in their place.

I wrote a mail to one of the developers now, let's see if he can help...
Title: Re: [Mac] PySFML - Install Error 'SFML/System.hpp' file not found
Post by: basteln on May 23, 2014, 10:19:20 am
Try this:
python setup.py build_ext --include-dirs=/usr/local/include -L/usr/lib -L/usr/local/lib