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

Author Topic: Installing PySFML on Python26  (Read 17040 times)

0 Members and 1 Guest are viewing this topic.

Ezbez

  • Newbie
  • *
  • Posts: 10
    • View Profile
Installing PySFML on Python26
« on: May 21, 2009, 10:54:33 pm »
A while back, I managed to install PySFML 1.3 onto Python25 and I'm very happy with it. Now I want to migrate onto SFML 1.4 and Python26, but I can't manage to install it.

I've followed the instructions given in the tutorial. Doing the development files install instructions seems to have no effect (that is, if I import PySFML, I am told there is no such module).

Following the SDK instructions, I don't understand this sentence:
Quote
If you want to build PySFML from the source code, you must have the SFML C++ headers and libraries in the SFML-x.x directory (as well as the "python" folder), and type the following command :


I take it this means I should download the "SFML full SDK" download. But now where exactly do I put it? I've tried extracting it and putting the contents into C:\python26\ (I'm using Windows XP). I've tried putting it in C:\python26\Lib\ and C:\python26\include\. I've put it in the PySFML-1.4 folder which I extracted and also within the PySFML-1.4/python/ directory.

All of these give me the same error:
": fatal error C1083: Cannot open include file: 'SFML/system/Clock.hpp': No such file or directory
error: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' failed with exit status 2"

Any help would be appreciated.

Edit: Oops, I should clarify something. When I say "putting the contents", "contents" is referring to the contents within an enclosing SFML/ folder.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Installing PySFML on Python26
« Reply #1 on: May 22, 2009, 08:46:22 am »
When you download and extract the PySFML SDK, you get a "python" directory.
When you download and extract the SFML SDK, you get a "SFML-1.4" directory. You can put it wherever you want, the "install" command will later take care of copying the binaries to the proper location.

Now just put the "python" directory" under "SFML-1.4" and that's it. You can follow the instructions of the tutorial, now it should work.
Laurent Gomila - SFML developer

remi.k2620

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • http://remi.tuxfamily.org
Re: Installing PySFML on Python26
« Reply #2 on: May 22, 2009, 11:34:37 am »
Quote from: "Ezbez"
Now I want to migrate onto SFML 1.4 and Python26, but I can't manage to install it.

I've followed the instructions given in the tutorial. Doing the development files install instructions seems to have no effect (that is, if I import PySFML, I am told there is no such module).


Yes, PySFML development files are for now only for python25, this is why it does not work when you try to install it for python26.

Ezbez

  • Newbie
  • *
  • Posts: 10
    • View Profile
Installing PySFML on Python26
« Reply #3 on: May 22, 2009, 11:47:27 am »
Thanks for that! I now can successfully compile the libs, but there's an error in the linking stage. The full output is below:

Code: [Select]
running build
running build_py
running build_ext
building 'PySFML.sf' extension
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:../lib/mingw /LIBPATH:C:\Python26\libs /LIBPATH:C:\Python26\PCbuild sfml-graphics.lib sfml-window.lib sfml-audio.lib sfml-system.lib /EXPORT:initsf build\temp.win32-2.6\Release\src/Clock.obj build\temp.win32-2.6\Release\src/Color.obj build\temp.win32-2.6\Release\src/Drawable.obj build\temp.win32-2.6\Release\src/Event.obj build\temp.win32-2.6\Release\src/Image.obj build\temp.win32-2.6\Release\src/Input.obj build\temp.win32-2.6\Release\src/Key.obj build\temp.win32-2.6\Release\src/main.obj build\temp.win32-2.6\Release\src/Music.obj build\temp.win32-2.6\Release\src/PostFX.obj build\temp.win32-2.6\Release\src/Rect.obj build\temp.win32-2.6\Release\src/RenderWindow.obj build\temp.win32-2.6\Release\src/Sleep.obj build\temp.win32-2.6\Release\src/Sprite.obj build\temp.win32-2.6\Release\src/String.obj build\temp.win32-2.6\Release\src/VideoMode.obj build\temp.win32-2.6\Release\src/View.obj build\temp.win32-2.6\Release\src/Window.obj build\temp.win32-2.6\Release\src/Joy.obj build\temp.win32-2.6\Release\src/Mouse.obj build\temp.win32-2.6\Release\src/WindowStyle.obj build\temp.win32-2.6\Release\src/Blend.obj build\temp.win32-2.6\Release\src/Sound.obj build\temp.win32-2.6\Release\src/SoundBuffer.obj build\temp.win32-2.6\Release\src/Listener.obj build\temp.win32-2.6\Release\src/SoundRecorder.obj build\temp.win32-2.6\Release\src/SoundBufferRecorder.obj build\temp.win32-2.6\Release\src/SoundStream.obj build\temp.win32-2.6\Release\src/Font.obj build\temp.win32-2.6\Release\src/Glyph.obj build\temp.win32-2.6\Release\src/Shape.obj build\temp.win32-2.6\Release\src/WindowSettings.obj /OUT:build\lib.win32-2.6\PySFML\sf.pyd /IMPLIB:build\temp.win32-2.6\Release\src\sf.lib /MANIFESTFILE:build\temp.win32-2.6\Release\src\sf.pyd.manifest
LINK : fatal error LNK1181: cannot open input file 'sfml-graphics.lib'


I do see sfml-graphics.lib in SFML/Lib/vc2008/, so I'm not sure why it's complaining.

remi.k2620

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • http://remi.tuxfamily.org
Installing PySFML on Python26
« Reply #4 on: May 22, 2009, 11:55:05 am »
Well, maybe you should replace ../lib/mingw  with the path to the .lib files (you can edit it in the setup.py file).

Ezbez

  • Newbie
  • *
  • Posts: 10
    • View Profile
Installing PySFML on Python26
« Reply #5 on: May 22, 2009, 11:28:57 pm »
Thanks! that let it progress a little further. Now I'm getting this:

Code: [Select]
build\temp.win32-2.6\Release\src\sf.exp
Color.obj : error LNK2019: unresolved external symbol "public: static class sf::Color const sf::Color::Cyan" (?Cyan@Color@sf@@2V12@B) referenced in function "void __cdecl PySfColor_InitConst(void)" (?PySfColor_InitConst@@YAXXZ)
Color.obj : error LNK2019: unresolved external symbol "public: static class sf::Color const sf::Color::Magenta" (?Magenta@Color@sf@@2V12@B) referenced in function "void __cdecl PySfColor_InitConst(void)" (?PySfColor_InitConst@@YAXXZ)
Color.obj : error LNK2019: unresolved external symbol "public: static class sf::Color const sf::Color::Yellow" (?Yellow@Color@sf@@2V12@B) referenced in function "void __cdecl PySfColor_InitConst(void)" (?PySfColor_InitConst@@YAXXZ)
Color.obj : error LNK2019: unresolved external symbol "public: static class sf::Color const sf::Color::Blue" (?Blue@Color@sf@@2V12@B) referenced in function "void __cdecl PySfColor_InitConst(void)" (?PySfColor_InitConst@@YAXXZ)
Color.obj : error LNK2019: unresolved external symbol "public: static class sf::Color const sf::Color::Green" (?Green@Color@sf@@2V12@B) referenced in function "void __cdecl PySfColor_InitConst(void)" (?PySfColor_InitConst@@YAXXZ)
Color.obj : error LNK2019: unresolved external symbol "public: static class sf::Color const sf::Color::Red" (?Red@Color@sf@@2V12@B) referenced in function "void __cdecl PySfColor_InitConst(void)" (?PySfColor_InitConst@@YAXXZ)
Color.obj : error LNK2019: unresolved external symbol "public: static class sf::Color const sf::Color::White" (?White@Color@sf@@2V12@B) referenced in function "void __cdecl PySfColor_InitConst(void)" (?PySfColor_InitConst@@YAXXZ)
Color.obj : error LNK2019: unresolved external symbol "public: static class sf::Color const sf::Color::Black" (?Black@Color@sf@@2V12@B) referenced in function "void __cdecl PySfColor_InitConst(void)" (?PySfColor_InitConst@@YAXXZ)
Shape.obj : error LNK2001: unresolved external symbol "public: static class sf::Color const sf::Color::Black" (?Black@Color@sf@@2V12@B)
Font.obj : error LNK2019: unresolved external symbol "private: static unsigned int * sf::Font::ourDefaultCharset" (?ourDefaultCharset@Font@sf@@0PAIA) referenced in function "struct _object * __cdecl PySfFont_LoadFromFile(struct PySfFont *,struct _object *,struct _object *)" (?PySfFont_LoadFromFile@@YAPAU_object@@PAUPySfFont@@PAU1@1@Z)
build\lib.win32-2.6\PySFML\sf.pyd : fatal error LNK1120: 9 unresolved externals


I think it's safe to say that the tutorial instructions need some elaborating on. :)

remi.k2620

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • http://remi.tuxfamily.org
Installing PySFML on Python26
« Reply #6 on: May 23, 2009, 05:54:42 pm »
Well, the problem is that i never tried to compile pysfml with visual studio.
Other people already tried to compile pysfml on windows, and often end with different errors, since it depends on which compiler you use, which version, which version of python, whether you link dynamically or statically, etc...
And i have to admit that i have no idea to explain your error :(

Ezbez

  • Newbie
  • *
  • Posts: 10
    • View Profile
Installing PySFML on Python26
« Reply #7 on: May 24, 2009, 02:20:24 am »
A shame. :( I'll do my best to poke around and try to find out a work-around or solution, but if you can't tell from my previous posts, I'm not so hot at all this. Still, maybe I'll find something.

For the record, I'm using Windows XP SP2 and VC++ 2008 Express Edition.

remi.k2620

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • http://remi.tuxfamily.org
Installing PySFML on Python26
« Reply #8 on: May 24, 2009, 01:01:40 pm »
I tried to compile pysfml 1.4 with gcc 4.4.0 and python 2.6.2.
I had a similar problem. I just had to define the macro SFML_DYNAMIC and it worked (see mingw tutorial). And it seems that visual studio also needs this macro (see the visual studio tutorial).
You can add this macro by editing the setup.py file. In the extension section, add define_macros=[('SFML_DYNAMIC', '1')] (for example after include dirs line 23).
When i'll have enough spare time i'll write a better setup.py file to make the compilation easier and to let you choose between static, dynamic, debug. I also uploaded what i just compiled here.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Installing PySFML on Python26
« Reply #9 on: May 24, 2009, 01:04:48 pm »
You should use the static C++ libraries, or add SFML_DYNAMIC to your preprocessor options.
Laurent Gomila - SFML developer

Ezbez

  • Newbie
  • *
  • Posts: 10
    • View Profile
Installing PySFML on Python26
« Reply #10 on: May 24, 2009, 03:13:26 pm »
Arg - so close! I added SFML_DYNAMIC to setup.py and now it looks like it builds fine. I install it after that, but then I get this error:

Code: [Select]
>>> import PySFML
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "PySFML\__init__.py", line 1, in <module>
    import sf
ImportError: DLL load failed: The specified module could not be found.


I get exactly the same error when I use remi's already compiled distribution.

Here's the log from building it
Code: [Select]
C:\Documents and Settings\Owner\Desktop\SFML-1.4\python>python26 setup.py build
running build
running build_py
running build_ext
building 'PySFML.sf' extension
creating build\temp.win32-2.6
creating build\temp.win32-2.6\Release
creating build\temp.win32-2.6\Release\src
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Clock.cpp /Fobuild\temp.win32-
2.6\Release\src/Clock.obj
Clock.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Color.cpp /Fobuild\temp.win32-
2.6\Release\src/Color.obj
Color.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Drawable.cpp /Fobuild\temp.win
32-2.6\Release\src/Drawable.obj
Drawable.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
src/Drawable.cpp(73) : warning C4244: 'argument' : conversion from 'double' to 'float', possible los
s of data
src/Drawable.cpp(79) : warning C4244: 'argument' : conversion from 'double' to 'float', possible los
s of data
src/Drawable.cpp(94) : warning C4244: 'argument' : conversion from 'double' to 'float', possible los
s of data
src/Drawable.cpp(100) : warning C4244: 'argument' : conversion from 'double' to 'float', possible lo
ss of data
src/Drawable.cpp(107) : warning C4244: 'argument' : conversion from 'double' to 'float', possible lo
ss of data
src/Drawable.cpp(183) : warning C4244: 'argument' : conversion from 'double' to 'float', possible lo
ss of data
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Event.cpp /Fobuild\temp.win32-
2.6\Release\src/Event.obj
Event.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Image.cpp /Fobuild\temp.win32-
2.6\Release\src/Image.obj
Image.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Input.cpp /Fobuild\temp.win32-
2.6\Release\src/Input.obj
Input.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Key.cpp /Fobuild\temp.win32-2.
6\Release\src/Key.obj
Key.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/main.cpp /Fobuild\temp.win32-2
.6\Release\src/main.obj
main.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Music.cpp /Fobuild\temp.win32-
2.6\Release\src/Music.obj
Music.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/PostFX.cpp /Fobuild\temp.win32
-2.6\Release\src/PostFX.obj
PostFX.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Rect.cpp /Fobuild\temp.win32-2
.6\Release\src/Rect.obj
Rect.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/RenderWindow.cpp /Fobuild\temp
.win32-2.6\Release\src/RenderWindow.obj
RenderWindow.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Sleep.cpp /Fobuild\temp.win32-
2.6\Release\src/Sleep.obj
Sleep.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
src/Sleep.cpp(30) : warning C4244: 'argument' : conversion from 'double' to 'float', possible loss o
f data
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Sprite.cpp /Fobuild\temp.win32
-2.6\Release\src/Sprite.obj
Sprite.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/String.cpp /Fobuild\temp.win32
-2.6\Release\src/String.obj
String.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
src/String.cpp(132) : warning C4244: 'argument' : conversion from 'double' to 'float', possible loss
 of data
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/VideoMode.cpp /Fobuild\temp.wi
n32-2.6\Release\src/VideoMode.obj
VideoMode.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/View.cpp /Fobuild\temp.win32-2
.6\Release\src/View.obj
View.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
src/View.cpp(130) : warning C4244: 'argument' : conversion from 'double' to 'float', possible loss o
f data
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Window.cpp /Fobuild\temp.win32
-2.6\Release\src/Window.obj
Window.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
src/Window.cpp(327) : warning C4244: 'argument' : conversion from 'double' to 'float', possible loss
 of data
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Joy.cpp /Fobuild\temp.win32-2.
6\Release\src/Joy.obj
Joy.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Mouse.cpp /Fobuild\temp.win32-
2.6\Release\src/Mouse.obj
Mouse.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/WindowStyle.cpp /Fobuild\temp.
win32-2.6\Release\src/WindowStyle.obj
WindowStyle.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Blend.cpp /Fobuild\temp.win32-
2.6\Release\src/Blend.obj
Blend.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Sound.cpp /Fobuild\temp.win32-
2.6\Release\src/Sound.obj
Sound.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
src/Sound.cpp(85) : warning C4244: 'argument' : conversion from 'double' to 'float', possible loss o
f data
src/Sound.cpp(92) : warning C4244: 'argument' : conversion from 'double' to 'float', possible loss o
f data
src/Sound.cpp(99) : warning C4244: 'argument' : conversion from 'double' to 'float', possible loss o
f data
src/Sound.cpp(106) : warning C4244: 'argument' : conversion from 'double' to 'float', possible loss
of data
src/Sound.cpp(207) : warning C4244: 'argument' : conversion from 'double' to 'float', possible loss
of data
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/SoundBuffer.cpp /Fobuild\temp.
win32-2.6\Release\src/SoundBuffer.obj
SoundBuffer.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Listener.cpp /Fobuild\temp.win
32-2.6\Release\src/Listener.obj
Listener.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
src/Listener.cpp(64) : warning C4244: 'argument' : conversion from 'double' to 'float', possible los
s of data
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/SoundRecorder.cpp /Fobuild\tem
p.win32-2.6\Release\src/SoundRecorder.obj
SoundRecorder.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/SoundBufferRecorder.cpp /Fobui
ld\temp.win32-2.6\Release\src/SoundBufferRecorder.obj
SoundBufferRecorder.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/SoundStream.cpp /Fobuild\temp.
win32-2.6\Release\src/SoundStream.obj
SoundStream.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
src/SoundStream.cpp(127) : warning C4244: 'argument' : conversion from 'double' to 'float', possible
 loss of data
src/SoundStream.cpp(134) : warning C4244: 'argument' : conversion from 'double' to 'float', possible
 loss of data
src/SoundStream.cpp(141) : warning C4244: 'argument' : conversion from 'double' to 'float', possible
 loss of data
src/SoundStream.cpp(148) : warning C4244: 'argument' : conversion from 'double' to 'float', possible
 loss of data
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Font.cpp /Fobuild\temp.win32-2
.6\Release\src/Font.obj
Font.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Glyph.cpp /Fobuild\temp.win32-
2.6\Release\src/Glyph.obj
Glyph.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/Shape.cpp /Fobuild\temp.win32-
2.6\Release\src/Shape.obj
Shape.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
src/Shape.cpp(103) : warning C4244: 'argument' : conversion from 'double' to 'float', possible loss
of data
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DSF
ML_DYNAMIC -I../include -IC:\Python26\include -IC:\Python26\PC /Tpsrc/WindowSettings.cpp /Fobuild\te
mp.win32-2.6\Release\src/WindowSettings.obj
WindowSettings.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception
handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:.
./lib/vc2008 /LIBPATH:C:\Python26\libs /LIBPATH:C:\Python26\PCbuild sfml-graphics.lib sfml-window.li
b sfml-audio.lib sfml-system.lib /EXPORT:initsf build\temp.win32-2.6\Release\src/Clock.obj build\tem
p.win32-2.6\Release\src/Color.obj build\temp.win32-2.6\Release\src/Drawable.obj build\temp.win32-2.6
\Release\src/Event.obj build\temp.win32-2.6\Release\src/Image.obj build\temp.win32-2.6\Release\src/I
nput.obj build\temp.win32-2.6\Release\src/Key.obj build\temp.win32-2.6\Release\src/main.obj build\te
mp.win32-2.6\Release\src/Music.obj build\temp.win32-2.6\Release\src/PostFX.obj build\temp.win32-2.6\
Release\src/Rect.obj build\temp.win32-2.6\Release\src/RenderWindow.obj build\temp.win32-2.6\Release\
src/Sleep.obj build\temp.win32-2.6\Release\src/Sprite.obj build\temp.win32-2.6\Release\src/String.ob
j build\temp.win32-2.6\Release\src/VideoMode.obj build\temp.win32-2.6\Release\src/View.obj build\tem
p.win32-2.6\Release\src/Window.obj build\temp.win32-2.6\Release\src/Joy.obj build\temp.win32-2.6\Rel
ease\src/Mouse.obj build\temp.win32-2.6\Release\src/WindowStyle.obj build\temp.win32-2.6\Release\src
/Blend.obj build\temp.win32-2.6\Release\src/Sound.obj build\temp.win32-2.6\Release\src/SoundBuffer.o
bj build\temp.win32-2.6\Release\src/Listener.obj build\temp.win32-2.6\Release\src/SoundRecorder.obj
build\temp.win32-2.6\Release\src/SoundBufferRecorder.obj build\temp.win32-2.6\Release\src/SoundStrea
m.obj build\temp.win32-2.6\Release\src/Font.obj build\temp.win32-2.6\Release\src/Glyph.obj build\tem
p.win32-2.6\Release\src/Shape.obj build\temp.win32-2.6\Release\src/WindowSettings.obj /OUT:build\lib
.win32-2.6\PySFML\sf.pyd /IMPLIB:build\temp.win32-2.6\Release\src\sf.lib /MANIFESTFILE:build\temp.wi
n32-2.6\Release\src\sf.pyd.manifest
   Creating library build\temp.win32-2.6\Release\src\sf.lib and object build\temp.win32-2.6\Release\
src\sf.exp
C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\mt.exe -nologo -manifest build\temp.win32-2.6\Rele
ase\src\sf.pyd.manifest -outputresource:build\lib.win32-2.6\PySFML\sf.pyd;2

C:\Documents and Settings\Owner\Desktop\SFML-1.4\python>


Here's the log from installing it:
Code: [Select]
C:\Documents and Settings\Owner\Desktop\SFML-1.4\python>python26 setup.py install
running install
running build
running build_py
running build_ext
running install_lib
creating C:\Python26\Lib\site-packages\PySFML
copying build\lib.win32-2.6\PySFML\sf.pyd -> C:\Python26\Lib\site-packages\PySFML
copying build\lib.win32-2.6\PySFML\__init__.py -> C:\Python26\Lib\site-packages\PySFML
copying build\lib.win32-2.6\PySFML\__init__.pyc -> C:\Python26\Lib\site-packages\PySFML
running install_egg_info
Writing C:\Python26\Lib\site-packages\PySFML-1.4-py2.6.egg-info


And here's setup.py:

Code: [Select]
#!/usr/bin/env python
# coding=UTF-8

from distutils.core import setup, Extension

setup(name='PySFML',
version='1.4',
description='Python binding for SFML (Simple and Fast Multimedia Library)',
author='Rémi Koenig',
author_email='remi.k2620@gmail.com',
url='http://www.sfml-dev.org/',
license='zlib/png',
ext_modules=[ Extension('PySFML.sf', \
['src/Clock.cpp', 'src/Color.cpp', 'src/Drawable.cpp', \
'src/Event.cpp', 'src/Image.cpp', 'src/Input.cpp', 'src/Key.cpp', 'src/main.cpp', \
'src/Music.cpp', 'src/PostFX.cpp', 'src/Rect.cpp', 'src/RenderWindow.cpp', 'src/Sleep.cpp', \
'src/Sprite.cpp', 'src/String.cpp', 'src/VideoMode.cpp', 'src/View.cpp', 'src/Window.cpp', \
'src/Joy.cpp', 'src/Mouse.cpp', 'src/WindowStyle.cpp', 'src/Blend.cpp', 'src/Sound.cpp', \
'src/SoundBuffer.cpp', 'src/Listener.cpp', 'src/SoundRecorder.cpp', 'src/SoundBufferRecorder.cpp', \
'src/SoundStream.cpp', 'src/Font.cpp', 'src/Glyph.cpp', 'src/Shape.cpp', 'src/WindowSettings.cpp' ], \
libraries=['sfml-graphics', 'sfml-window', 'sfml-audio', 'sfml-system'], \
library_dirs=['../lib/vc2008'], \
include_dirs=['../include'],
define_macros=[('SFML_DYNAMIC',None)]
)],
package_dir = {'PySFML':'PySFML'},
packages=['PySFML'],
)

remi.k2620

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • http://remi.tuxfamily.org
Installing PySFML on Python26
« Reply #11 on: May 24, 2009, 03:38:40 pm »
The libraries are linked dynamically, so the dlls need to be accessible. You can put them in the same folder as the current folder from where you call python, in your system folder, or in the folder where pysfml is installed. For the latter option, run python setup.py install, look where pysfml is installed (for example C:\Python26\Libs\site-packages\PySFML) and add the dlls to this folder.
The dlls you need are the sfml dlls (except the network one), libsndfile and openal (they couldn't be included in sfml's dlls because of their license, but are provided in the extlibs folder of the full sdk).

Ezbez

  • Newbie
  • *
  • Posts: 10
    • View Profile
Installing PySFML on Python26
« Reply #12 on: May 24, 2009, 03:56:28 pm »
Thanks a bunch! It works now.

If you and Laurent would like, I can write up all the steps I had to go through as a complete VC++ 2008 installation guide. Seems like the least I could do after you two helped me so much.

remi.k2620

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • http://remi.tuxfamily.org
Installing PySFML on Python26
« Reply #13 on: May 24, 2009, 04:08:07 pm »
Yes, good idea. You can post it on the wiki ;)

Ezbez

  • Newbie
  • *
  • Posts: 10
    • View Profile
Installing PySFML on Python26
« Reply #14 on: May 25, 2009, 12:54:36 pm »
Alright, I posted the instructions!