intjelic / python-sfml

Official binding of SFML for Python
https://www.python-sfml.org
Other
176 stars 41 forks source link

Error in sfml/system when compiling from git #150

Closed TheZoq2 closed 7 years ago

TheZoq2 commented 7 years ago

I am trying to compile the project from source since pip install pySFML doesn't seem to work.

Running pip install git+https://github.com/Sonkun/python-sfml or cloning the repo and then running python3 setup.py gives the following error:

   Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-1sv4c16z-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-bi057ak3-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/sfml
    copying src/sfml/sf.py -> build/lib.linux-x86_64-3.6/sfml
    copying src/sfml/__init__.py -> build/lib.linux-x86_64-3.6/sfml
    running build_ext
    cythoning src/sfml/system/system.pyx to src/sfml/system/system.cpp
    building 'sfml.system' extension
    creating build/temp.linux-x86_64-3.6/src
    creating build/temp.linux-x86_64-3.6/src/sfml
    creating build/temp.linux-x86_64-3.6/src/sfml/system
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fPIC -Iinclude/Includes -I/usr/include/python3.6m -Ibuild/temp.linux-x86_64-3.6/include -c src/sfml/system/system.cpp -o build/temp.linux-x86_64-3.6/src/sfml/system/system.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    src/sfml/system/system.cpp: In function ‘PyObject* __pyx_pf_4sfml_6system_4Time_18__mod__(PyTimeObject*, PyTimeObject*)’:
    src/sfml/system/system.cpp:8770:44: error: no match for ‘operator%’ (operand types are ‘sf::Time’ and ‘sf::Time’)
       (__pyx_v_p[0]) = ((__pyx_v_x->p_this[0]) % (__pyx_v_y->p_this[0]));
                         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
    src/sfml/system/system.cpp: In function ‘PyObject* __pyx_pf_4sfml_6system_4Time_28__imod__(PyTimeObject*, PyTimeObject*)’:
    src/sfml/system/system.cpp:9273:29: error: no match for ‘operator%=’ (operand types are ‘sf::Time’ and ‘sf::Time’)
       (__pyx_v_self->p_this[0]) %= (__pyx_v_x->p_this[0]);
       ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
    error: command 'gcc' failed with exit status 1

Edit: This is on an up to date Arch Linux system with SFML 2.4.2-1 installed.

intjelic commented 7 years ago

Are you using SFML 2.3.2 ?

TheZoq2 commented 7 years ago

No, but now that you mention it, I suppose that's required. SFML 2.4.2 is what's installed on my system.

Do I need to install 2.3.2 instead for it to work?

intjelic commented 7 years ago

Yes, I haven't updated the bindings yet ...

TheZoq2 commented 7 years ago

Ah, makes sense. Thanks for the quick reply.

intjelic commented 7 years ago

You're welcome!