Bienvenue, Invité. Merci de vous connecter ou de vous inscrire.
Avez-vous perdu votre e-mail d'activation ?

Auteur Sujet: [Solved] Problème compilation PYSFML 2 python 3.2 (pysfml-cython)  (Lu 4471 fois)

0 Membres et 1 Invité sur ce sujet

gaulois94

  • Sr. Member
  • ****
  • Messages: 259
    • Voir le profil
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 :)
« Modifié: Novembre 04, 2013, 09:40:28 am par Sonkun »

gaulois94

  • Sr. Member
  • ****
  • Messages: 259
    • Voir le profil
Re: Problème compilation PYSFML 2 python 3.2
« Réponse #1 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) ).

bastien

  • Full Member
  • ***
  • Messages: 231
    • Voir le profil
    • http://bastien-leonard.alwaysdata.net
Re: Problème compilation PYSFML 2 python 3.2
« Réponse #2 le: Avril 02, 2012, 06:52:52 pm »
Merci, c'est corrigé.
Check out pysfml-cython, an up to date Python 2/3 binding for SFML 2: https://github.com/bastienleonard/pysfml-cython

gaulois94

  • Sr. Member
  • ****
  • Messages: 259
    • Voir le profil
Re: Problème compilation PYSFML 2 python 3.2
« Réponse #3 le: Avril 02, 2012, 08:26:16 pm »
de rien et merci encore à toi :D

gaulois94

  • Sr. Member
  • ****
  • Messages: 259
    • Voir le profil
Re: Problème compilation PYSFML 2 python 3.2
« Réponse #4 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.

bastien

  • Full Member
  • ***
  • Messages: 231
    • Voir le profil
    • http://bastien-leonard.alwaysdata.net
Re: Problème compilation PYSFML 2 python 3.2
« Réponse #5 le: Avril 03, 2012, 07:49:14 am »
Tu as bien exécuté patch.py ?
Check out pysfml-cython, an up to date Python 2/3 binding for SFML 2: https://github.com/bastienleonard/pysfml-cython

gaulois94

  • Sr. Member
  • ****
  • Messages: 259
    • Voir le profil
Re: Problème compilation PYSFML 2 python 3.2
« Réponse #6 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.

bastien

  • Full Member
  • ***
  • Messages: 231
    • Voir le profil
    • http://bastien-leonard.alwaysdata.net
Re: Problème compilation PYSFML 2 python 3.2
« Réponse #7 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.
Check out pysfml-cython, an up to date Python 2/3 binding for SFML 2: https://github.com/bastienleonard/pysfml-cython

gaulois94

  • Sr. Member
  • ****
  • Messages: 259
    • Voir le profil
Re: Problème compilation PYSFML 2 python 3.2
« Réponse #8 le: Avril 04, 2012, 12:39:43 pm »
Merci :) tout fonctionne impeccablement ;) .

gaulois94

  • Sr. Member
  • ****
  • Messages: 259
    • Voir le profil
Re : Problème compilation PYSFML 2 python 3.2
« Réponse #9 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é.
« Modifié: Avril 06, 2012, 10:53:49 pm par gaulois94 »