Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Bld error on ubuntu11.04  (Read 6272 times)

0 Members and 1 Guest are viewing this topic.

njohn

  • Newbie
  • *
  • Posts: 2
    • View Profile
Bld error on ubuntu11.04
« 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:


Quote

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>

Quote

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..

njohn

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Bld error on ubuntu11.04 [Fixed]
« Reply #1 on: September 10, 2011, 07:08:43 pm »
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...


Quote from: "njohn"
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:


Quote

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>

Quote

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..

bastien

  • Full Member
  • ***
  • Posts: 231
    • View Profile
    • http://bastien-leonard.alwaysdata.net
Bld error on ubuntu11.04
« Reply #2 on: September 10, 2011, 07:29:49 pm »
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.
Check out pysfml-cython, an up to date Python 2/3 binding for SFML 2: https://github.com/bastienleonard/pysfml-cython

 

anything