bastienleonard/pysfml2-cython — Issue #17: Can't build for Python3
Author: L-P
Created: 2012-03-03 11:33:04+00:00
State: open

I followed the instructions and it failed for Python3, building for Python2 seems to work fine.

Here is the log :
```
[2123:0]@leo-laptop:src$ /home/leo/Documents/src/Cython-0.15.1/cython.py --cplus sf.pyx

[2124:0]@leo-laptop:src$ cd ..

[2125:0]@leo-laptop:pysfml2-cython$ py setup3k.py build_ext
running build_ext
building 'sf' extension
gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python3.2mu -c src/sf.cpp -o build/temp.linux-x86_64-3.2/src/sf.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
src/sf.cpp: In function ‘PyObject* __pyx_pf_2sf_9Transform_6matrix___get__(PyObject*)’:
src/sf.cpp:7551:8: warning: variable ‘__pyx_v_i’ set but not used [-Wunused-but-set-variable]
src/sf.cpp: In function ‘PyObject* __pyx_pf_2sf_5Chunk_7samples___get__(PyObject*)’:
src/sf.cpp:13662:10: warning: variable ‘__pyx_v_i’ set but not used [-Wunused-but-set-variable]
src/sf.cpp: At global scope:
src/sf.cpp:26578:37: warning: ‘__pyx_obj_2sf_Vertex* __pyx_f_2sf_wrap_vertex_instance(sf::Vertex*)’ defined but not used [-Wunused-function]
gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python3.2mu -c src/hacks.cpp -o build/temp.linux-x86_64-3.2/src/hacks.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
In file included from src/hacks.cpp:30:0:
src/sf.h:15:32: error: expected constructor, destructor, or type conversion before ‘set_error_message’
src/sf.h:16:40: error: expected constructor, destructor, or type conversion before ‘convert_to_vector2f’
src/sf.h:17:53: error: expected constructor, destructor, or type conversion before ‘*’ token
src/sf.h:18:54: error: expected constructor, destructor, or type conversion before ‘*’ token
src/sf.h:19:61: error: expected constructor, destructor, or type conversion before ‘*’ token
src/sf.h:20:61: error: expected constructor, destructor, or type conversion before ‘*’ token
src/hacks.cpp: In member function ‘virtual int MyBuff::sync()’:
src/hacks.cpp:103:38: error: ‘set_error_message’ was not declared in this scope
src/hacks.cpp: In member function ‘virtual void CppDrawable::Draw(sf::RenderTarget&, sf::RenderStates) const’:
src/hacks.cpp:137:73: error: ‘wrap_render_target_instance’ was not declared in this scope
src/hacks.cpp:139:37: error: ‘wrap_render_states_instance’ was not declared in this scope
src/hacks.cpp: In member function ‘virtual sf::Vector2f CppShape::GetPoint(unsigned int) const’:
src/hacks.cpp:206:40: error: ‘convert_to_vector2f’ was not declared in this scope
src/hacks.cpp: In member function ‘virtual bool CppSoundStream::OnGetData(sf::SoundStream::Chunk&)’:
src/hacks.cpp:239:69: error: ‘wrap_chunk_instance’ was not declared in this scope
src/hacks.cpp: In member function ‘virtual void CppSoundStream::OnSeek(sf::Time)’:
src/hacks.cpp:277:34: error: ‘wrap_time_instance’ was not declared in this scope
error: command 'gcc' failed with exit status 1
```

Other infos :
```
[2155:0]@leo-laptop:~$ py
Python 3.2.2 (default, Sep 5 2011, 21:17:14)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

[2155:0]@leo-laptop:~$ uname -a
Linux leo-laptop 3.0.0-16-generic #28-Ubuntu SMP Fri Jan 27 17:44:39 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

[2156:0]@leo-laptop:~$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
```