I am trying to build a downloaded Python app on Windows that uses Pygame. I have installed Python 2.5 and Pygame 1.7.1. I am new to Python, but I just tried typing the name of the top level .py file on a Windows console command line. (I'm using Win XP Pro.)
This is the message that I get.
C:\Python25\include\pygame\pygame.h(68) : fatal error C1083: Cannot open include file: 'SDL.h': No such file or directory
I thought that Pygame was built on top of SDL and that a separate SDL install was not necessary. Nevertheless, I installed SDL 1.2.13 and added the SDL include folder to my %INCLUDE% environment variable. Still no luck.
I noticed that C:\Python25\Lib\site-packages\pygame includes several SDL*.DLL files, but there is no sdl.h header file anywhere in the python tree. Of course, I could copy the sdl headers into the C:\Python25\include\pygame folder, but that is a distasteful idea.
Anybody know the right way to set things up?
EDIT: The application is "The Penguin Machine" pygame app.
When you compile something the compiler looks up header files in several directories, some hardcoded and build in, and typically some given as arguments to the compiler (like for instance "gcc -I/usr/local/include ..."). One guess is that you are missing this. If not check out other possible causes to your error message.
You will need to have the SDL Development Libraries installed, but since you say "I could copy the sdl headers" it sounds like you already have. Then your problem is only to get the compiler to look in the include directory containing those files.
I tried compiling and got the same errors on my linux box:
Seems like it tries to compile a extension called
surfutils
which needs SDL development headers.So I installed the
libsdl1.2-dev
package using my distribution package manager and it worked just fine. You must install SDL development headers in order to build it for your system.So your question really is: How do I install SDL development headers on windows, and how I make the program use them?
Well, I can answer the second question. You must edit setup.py:
Change line 9. It says:
Change this path to wherever your SDL headers are, i.e.:
Leave a note to the game developer to say you're having this trouble. It could provide a better way of finding SDL headers on your platform.