I tried compiling and got the same errors on my linux box:
$ python setup.py build
DBG> include = ['/usr/include', '/usr/include/python2.6', '/usr/include/SDL']
running build
running build_ext
building 'surfutils' extension
creating build
creating build/temp.linux-i686-2.6
creating build/temp.linux-i686-2.6/src
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include -I/usr/include/python2.6 -I/usr/include/SDL -I/usr/include/python2.6 -c src/surfutils.c -o build/temp.linux-i686-2.6/src/surfutils.o
In file included from src/surfutils.c:1:
/usr/include/python2.6/pygame/pygame.h:68:17: error: SDL.h: Arquivo ou diretório inexistente
In file included from src/surfutils.c:1:
/usr/include/python2.6/pygame/pygame.h:312: error: expected specifier-qualifier-list before ‘SDL_VideoInfo’
/usr/include/python2.6/pygame/pygame.h:350: error: expected specifier-qualifier-list before ‘SDL_Surface’
src/surfutils.c:5: error: expected ‘)’ before ‘*’ token
src/surfutils.c: In function ‘PyCollisionPoint’:
src/surfutils.c:74: error: ‘SDL_Surface’ undeclared (first use in this function)
src/surfutils.c:74: error: (Each undeclared identifier is reported only once
src/surfutils.c:74: error: for each function it appears in.)
src/surfutils.c:74: error: ‘surf1’ undeclared (first use in this function)
src/surfutils.c:74: error: ‘surf2’ undeclared (first use in this function)
src/surfutils.c:74: warning: left-hand operand of comma expression has no effect
src/surfutils.c:92: error: ‘PySurfaceObject’ has no member named ‘surf’
src/surfutils.c:97: error: ‘SDL_SRCALPHA’ undeclared (first use in this function)
src/surfutils.c:111: error: ‘PySurfaceObject’ has no member named ‘surf’
src/surfutils.c:161: warning: implicit declaration of function ‘collisionPoint’
error: command 'gcc' failed with exit status 1
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:
#!/usr/bin/env python2.3
from distutils.core import setup, Extension
from distutils.sysconfig import get_config_vars
includes = []
includes.extend(get_config_vars('INCLUDEDIR'))
includes.extend(get_config_vars('INCLUDEPY'))
includes.append('/usr/include/SDL')
print 'DBG> include =', includes
setup(name='surfutils',
version='1.0',
ext_modules=[Extension(
'surfutils',
['src/surfutils.c'],
include_dirs=includes,
)],
)
Change line 9. It says:
includes.append('/usr/include/SDL')
Change this path to wherever your SDL headers are, i.e.:
includes.append(r'C:\mydevelopmentheaders\SDL')
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.