SFML community forums
Bindings - other languages => Python => Topic started by: njohn on September 09, 2011, 06:47:28 pm
-
Hi,
Following the instructions shown here: http://pysfml2-cython.readthedocs.org/en/latest/building.html#building-with-cython-installed
I'm getting the following error:
njohn@natty1:~/code/pysfml2-cython$ python setup.py build_ext --inplace
running build_ext
cythoning sf.pyx to sf.cpp
Error converting Pyrex file to C:
------------------------------------------------------------
...
# Hack for static methods and attributes
cdef extern from "SFML/Graphics.hpp" namespace "sf::Keyboard":
cdef cppclass Key:
pass
bint IsKeyPressed(Key)
^
------------------------------------------------------------
/home/njohn/code/pysfml2-cython/declkey.pxd:43:21: Function argument cannot have C name specification
Error converting Pyrex file to C:
------------------------------------------------------------
...
cdef extern from "SFML/Graphics.hpp" namespace "sf::VideoMode":
cdef VideoMode& GetDesktopMode()
cdef vector[VideoMode]& GetFullscreenModes()
cdef extern from "SFML/Graphics.hpp" namespace "sf::Matrix3":
cdef Matrix3 Transformation(Vector2f&, Vector2f&, float, Vector2f&)
^
<snip>
Error converting Pyrex file to C:
------------------------------------------------------------
...
raise PySFMLException("Couldn't open music in file " + filename)
@classmethod
def open_from_memory(cls, bytes data):
cdef declaudio.Music *p = new declaudio.Music()
^
------------------------------------------------------------
/home/njohn/code/pysfml2-cython/sf.pyx:991:38: new operator can only be applied to a C++ class
building 'sf' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c sf.cpp -o build/temp.linux-x86_64-2.7/sf.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
sf.cpp:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
error: command 'gcc' failed with exit status 1
I'm build the latest version just pulled from github
python version 2.7.1
Anybody know what I'm doing wrong or missing?
Thanks in advance..
-
Fixed...
Turns out, version of cython that ships with ubuntu 11.04 is 0.13, removed and easy installed version 0.15. Fixes my problem...
Hi,
Following the instructions shown here: http://pysfml2-cython.readthedocs.org/en/latest/building.html#building-with-cython-installed
I'm getting the following error:
njohn@natty1:~/code/pysfml2-cython$ python setup.py build_ext --inplace
running build_ext
cythoning sf.pyx to sf.cpp
Error converting Pyrex file to C:
------------------------------------------------------------
...
# Hack for static methods and attributes
cdef extern from "SFML/Graphics.hpp" namespace "sf::Keyboard":
cdef cppclass Key:
pass
bint IsKeyPressed(Key)
^
------------------------------------------------------------
/home/njohn/code/pysfml2-cython/declkey.pxd:43:21: Function argument cannot have C name specification
Error converting Pyrex file to C:
------------------------------------------------------------
...
cdef extern from "SFML/Graphics.hpp" namespace "sf::VideoMode":
cdef VideoMode& GetDesktopMode()
cdef vector[VideoMode]& GetFullscreenModes()
cdef extern from "SFML/Graphics.hpp" namespace "sf::Matrix3":
cdef Matrix3 Transformation(Vector2f&, Vector2f&, float, Vector2f&)
^
<snip>
Error converting Pyrex file to C:
------------------------------------------------------------
...
raise PySFMLException("Couldn't open music in file " + filename)
@classmethod
def open_from_memory(cls, bytes data):
cdef declaudio.Music *p = new declaudio.Music()
^
------------------------------------------------------------
/home/njohn/code/pysfml2-cython/sf.pyx:991:38: new operator can only be applied to a C++ class
building 'sf' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c sf.cpp -o build/temp.linux-x86_64-2.7/sf.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
sf.cpp:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.
error: command 'gcc' failed with exit status 1
I'm build the latest version just pulled from github
python version 2.7.1
Anybody know what I'm doing wrong or missing?
Thanks in advance..
-
Someone else had the same problem, I added a warning in the documentation since a lot of people use Ubuntu and it's difficult to see where the problem comes from when the error occurs.