Forum de la communauté SFML

Bindings - autres langages => Python => Discussion démarrée par: gaulois94 le Mars 30, 2012, 08:44:03 pm

Titre: [Solved] Problème compilation PYSFML 2 python 3.2 (pysfml-cython)
Posté par: gaulois94 le Mars 30, 2012, 08:44:03 pm
Bonsoirs,

voila je recontre un petit problème lors de la tentative de compilation de pysfml 2 building python 3. Je pense que cela est dû à la version de SFML 2 qui date d'aujourd'hui. Voici le code erreur :

python3.2 setup3k.py build_ext

If the build fails, run patch.py and try again
----------------------------------------------

running build_ext
building 'sfml' extension
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python3.2m -c src/sfml.cpp -o build/temp.linux-x86_64-3.2/src/sfml.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
src/sfml.cpp: In function ‘PyObject* __pyx_pf_4sfml_9Transform_6matrix___get__(PyObject*)’:
src/sfml.cpp:7848:8: warning: variable ‘__pyx_v_i’ set but not used [-Wunused-but-set-variable]
src/sfml.cpp: In function ‘PyObject* __pyx_pf_4sfml_12RenderTarget_3convert_coords(PyObject*, PyObject*, PyObject*)’:
src/sfml.cpp:33510:116: error: no matching function for call to ‘sf::RenderTarget::convertCoords(unsigned int&, unsigned int&)’
src/sfml.cpp:33510:116: note: candidates are:
/usr/local/include/SFML/Graphics/RenderTarget.hpp:152:14: note: sf::Vector2f sf::RenderTarget::convertCoords(const Vector2i&) const
/usr/local/include/SFML/Graphics/RenderTarget.hpp:152:14: note:   candidate expects 1 argument, 2 provided
/usr/local/include/SFML/Graphics/RenderTarget.hpp:177:14: note: sf::Vector2f sf::RenderTarget::convertCoords(const Vector2i&, const sf::View&) const
/usr/local/include/SFML/Graphics/RenderTarget.hpp:177:14: note:   no known conversion for argument 1 from ‘unsigned int’ to ‘const Vector2i& {aka const sf::Vector2<int>&}’
src/sfml.cpp:33522:143: error: no matching function for call to ‘sf::RenderTarget::convertCoords(unsigned int&, unsigned int&, sf::View&)’
src/sfml.cpp:33522:143: note: candidates are:
/usr/local/include/SFML/Graphics/RenderTarget.hpp:152:14: note: sf::Vector2f sf::RenderTarget::convertCoords(const Vector2i&) const
/usr/local/include/SFML/Graphics/RenderTarget.hpp:152:14: note:   candidate expects 1 argument, 3 provided
/usr/local/include/SFML/Graphics/RenderTarget.hpp:177:14: note: sf::Vector2f sf::RenderTarget::convertCoords(const Vector2i&, const sf::View&) const
/usr/local/include/SFML/Graphics/RenderTarget.hpp:177:14: note:   candidate expects 2 arguments, 3 provided
src/sfml.cpp: At global scope:
src/sfml.cpp:27597:39: warning: ‘__pyx_obj_4sfml_Vertex* __pyx_f_4sfml_wrap_vertex_instance(sf::Vertex*)’ defined but not used [-Wunused-function]
error: command 'gcc' failed with exit status 1

Voila, merci d'avance :)
Titre: Re: Problème compilation PYSFML 2 python 3.2
Posté par: gaulois94 le Avril 01, 2012, 11:03:26 pm
Bon ben il faut juste attendre à ce que pysfml se met à jours alors (heureusement que j'ai une version fonctionnels sur mon netbook x) ).
Titre: Re: Problème compilation PYSFML 2 python 3.2
Posté par: bastien le Avril 02, 2012, 06:52:52 pm
Merci, c'est corrigé.
Titre: Re: Problème compilation PYSFML 2 python 3.2
Posté par: gaulois94 le Avril 02, 2012, 08:26:16 pm
de rien et merci encore à toi :D
Titre: Re: Problème compilation PYSFML 2 python 3.2
Posté par: gaulois94 le Avril 02, 2012, 08:43:16 pm
Je suis désoler mais j'ai encore quelques petits problèmes de compilations que voici :

mickael@Sereno: ~/Téléchargements/bastienleonard-pysfml2-cython-6c4b128$ su -c "python3 setup3k.py build_ext"
Mot de passe :

If the build fails, run patch.py and try again
----------------------------------------------

running build_ext
building 'sfml' extension
gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIC -I/usr/include/python3.2mu -c src/sfml.cpp -o build/temp.linux-x86_64-3.2/src/sfml.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for Ada/C/ObjC but not for C++ [enabled by default]
src/sfml.cpp: In function ‘PyObject* __pyx_pf_4sfml_9Transform_6matrix___get__(PyObject*)’:
src/sfml.cpp:7848:8: warning: variable ‘__pyx_v_i’ set but not used [-Wunused-but-set-variable]
src/sfml.cpp: At global scope:
src/sfml.cpp:27805:39: warning: ‘__pyx_obj_4sfml_Vertex* __pyx_f_4sfml_wrap_vertex_instance(sf::Vertex*)’ defined but not used [-Wunused-function]
gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -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:32:0:
src/sfml.h:15:32: error: expected constructor, destructor, or type conversion before ‘set_error_message’
src/sfml.h:16:40: error: expected constructor, destructor, or type conversion before ‘convert_to_vector2f’
src/sfml.h:17:55: error: expected constructor, destructor, or type conversion before ‘*’ token
src/sfml.h:18:56: error: expected constructor, destructor, or type conversion before ‘*’ token
src/sfml.h:19:63: error: expected constructor, destructor, or type conversion before ‘*’ token
src/sfml.h:20:63: error: expected constructor, destructor, or type conversion before ‘*’ token
src/hacks.cpp: In member function ‘virtual int MyBuff::sync()’:
src/hacks.cpp:105: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:139:73: error: ‘wrap_render_target_instance’ was not declared in this scope
src/hacks.cpp:141: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:208: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:241: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:279:34: error: ‘wrap_time_instance’ was not declared in this scope
error: command 'gcc' failed with exit status 1

merci encore.
Titre: Re: Problème compilation PYSFML 2 python 3.2
Posté par: bastien le Avril 03, 2012, 07:49:14 am
Tu as bien exécuté patch.py ?
Titre: Re: Problème compilation PYSFML 2 python 3.2
Posté par: gaulois94 le Avril 03, 2012, 11:13:11 pm
en effet je l'avais oublié x) . Dernière question : où je mes la librairie (le .so créé) ? Si je le met dans /usr/lib, il ne fonctionne pas (import sfml retourne une erreur).

Merci encore.
Titre: Re: Problème compilation PYSFML 2 python 3.2
Posté par: bastien le Avril 04, 2012, 09:48:51 am
Perso je me contente de le copier dans le répertoire de chaque projet. Pour l'installer globalement, il faut le mettre dans /usr/lib/pythonx.y/site-packages. C'est ce que fait la command python setup.py install automatiquement.
Titre: Re: Problème compilation PYSFML 2 python 3.2
Posté par: gaulois94 le Avril 04, 2012, 12:39:43 pm
Merci :) tout fonctionne impeccablement ;) .
Titre: Re : Problème compilation PYSFML 2 python 3.2
Posté par: gaulois94 le Avril 06, 2012, 10:51:57 pm
Désoler mais j'ai quand même chercher un minimum. Le début du problème venait de pysfml lui même (dû au fait que la SFML se mettent à jours), et le second problème venait de moi c'est vrai (j'avais oublié la présence de patch.py : sa arrive à tout le monde...) et pour le dernière demande, je ne peut deviner qu'il y ai une troisième option pour setup.py...

Sinon en parlant de la librairie, tu a dit que tu le met dans chacun de tes dossiers, mais cela ne fonctionnera que pour Windows, pas pour linux ;) (enfin je crois :p). Pourquoi ? Ben désoler on ne compile pas de la même manière sous chaque distribution et que comme je suis en 64 bits, les utilisateurs 32 bits ne pourront l'utilisé.