Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 218519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:45:31+00:00 2026-05-11T18:45:31+00:00

I am trying to build a downloaded Python app on Windows that uses Pygame.

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T18:45:31+00:00Added an answer on May 11, 2026 at 6:45 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 136k
  • Answers 136k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I found this article, it may help, http://www.silverlightshow.net/items/Cookies-in-Silverlight-Web-Requests.aspx It says… May 12, 2026 at 7:08 am
  • Editorial Team
    Editorial Team added an answer Use backticks ( `` ) or nothing at all instead… May 12, 2026 at 7:08 am
  • Editorial Team
    Editorial Team added an answer Use Beautiful Soup like everyone does. May 12, 2026 at 7:08 am

Related Questions

I am supporting an application with a hard dependency on python-devel 2.3.7. The application
How do I set up a Git project to contains other projects? eg. I
I am trying to use Aptana to build an IPhone web application. I've never
I am trying to learn how to use MSBuild so we can use it

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.