Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

SDL_Perl for Win32?

by jryan (Vicar)
on Feb 02, 2005 at 22:24 UTC ( #427452=perlquestion: print w/replies, xml ) Need Help??
jryan has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to get SDL_Perl to build on my Win2k machine, and I've completely lost hope on it.

Unfortunately, SDL_Perl uses Module::Build, which means its pretty much game over for me. The make script relies on sdl-config, which doesn't come with the binary release of SDL 1.2. However, since the build process uses Module::Build (and I've never *EVER* gotten a Perl module that uses Module::Build to build on any Windows box) I can't manually configure the make file.

I'm tearing my hair out here. I'd really like to be able to use Perl to this project, but for that to happen, I need SDL_Perl to work. Has anyone ever gotten SDL_Perl to build on a Windows box? If so, could I have a binary copy? :)

(Update: I've found a copy of SDL_Perl in crazyinsomniac's ppm repository, but it seems to be compiled for an earlier version of Perl, as it segfaults my machine as well as a friend's.)

Replies are listed 'Best First'.
Re: SDL_Perl for Win32?
by chromatic (Archbishop) on Feb 03, 2005 at 01:32 UTC

    The problem is not Module::Build. The problem is that Windows is such a hostile environment for compiling that no one who's looked can answer a handful of questions:

    • How can the installer tell if the system has OpenGL installed?
    • If the system has OpenGL installed, who is the vendor? (Answers include Microsoft, a video card manufacturer, and Mesa.)
    • Where are the SDL headers?
    • Which additional SDL libraries are present?

    In seven or eight months of trying, I've personally never found a sensible answer to any of these questions. Fortunately, using Module::Build makes it easy to hide platform-specific configuration code behind a sane interface, a phrase that only a deranged lunatic even the fine people of Innsmouth would shun (and rightly so) could possibly apply to MakeMaker.

    I don't think you can install SDL_Perl without having at least the SDL development files installed, and I think that includes the sdl_config file, but that will leave you with several other questions to answer.

    If you do make any progress, I'd love to hear about it on the sdl-devel list.

      In seven or eight months of trying, I've personally never found a sensible answer to any of these questions.
      Most of those questions you can answer progamatically (and some you don't even have to answer), but asking the user sounds sensible to me (with shortcuts like perl Build.PL --opengl=-lmesa --smpeg --gfx ...).

      What isn't sensible (imho) is something like

      package SDL::Build::MSWin32; ... sub find_header { for my $key (qw( LIBS PATH )) { die "Environment variable $key is empty\n" unless $ENV{$key}; }
      That is needless death right there (besides, its always LIB and only optionally LIBS). Since sdl-config won't exist on win32 (when dealing with MSVS), makes no sense to die if it doesn't exist, especially if SDL.h/SDL.lib area already in the include/lib path.

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.

        Do binary installations of SDL include the headers? As you know, the build will fail without headers. If you can show me a sane way to find the headers, I'll put it in the code.

      I don't know. I know that Windows isn't the greatest environment to build stuff, but thats the platform that I have to use here.

      My problem with Module::Build is that when something wrong happens, I haven't a clue what I need to do to fix it. Its so frustrating! At least with MakeMaker I can look at the makefile and try to config stuff manually, by hand. I can see the dependencies. I can see which information it needs to build. I can see that it requires header files to install. A build system that requires me to be intimately familiar with its internals is useless to me.

      I mean, dammit! I don't care how the thing builds, I just want to use it! I'm even very willing to spend lots of time trying to get it to install, because I need it. Its just when the build system says essentially says "sorry, the automatic configure system isn't working", and thats all the output I get, I... its just... AARRRRRGHHH!

        Just a guess - you should use 'nmake' but using 'make'; or may be is not precise enough; which way did you obtained Perl binaries

      Every "recent" version of Win32 (that is, Windows 98, Windows ME, Windows NT, 2000 and Windows XP) has OpenGL installed by default, for Windows 95, points to a download. This is, of course, only the SGI/Microsoft software renderer, but that is enough for a start.

      The official way to query the OpenGL vendor is to load the OpenGL libary and then use the glGetString call to get the vendor string. Win32::API can easily load shared libraries and call functions in it, not unlike a module you wrote for Linux (I think). Finding the fitting OpenGL library headers is somewhat harder, as they first must be installed and second the script must find them - I would let the user specify that.

      The SDL headers and additional SDL libraries should simply be inquired from the user if a sane set of defaults doesn't fit. Please do not enter into an infinite loop if there is no user present to answer your question, but bail out of the build script.

        Would the appropriate Win32::API code look something like this?

        use Win32::API; my $gl_vendor = Win32::API->new( "OpenGL", "char* glGetString(unsigned int a)" )->Call( 0x1F00 );

        I could see looping over that and using mesagl instead of OpenGL too.

Re: SDL_Perl for Win32?
by Anonymous Monk on Feb 03, 2005 at 02:32 UTC
    For which compiler of choice? I sympathize with your problem.

      Plain ole cl, the free one from Microsoft.

SDL_Perl for Mac OS X
by crenz (Priest) on Feb 03, 2005 at 21:27 UTC
    I sympathise with you. I recently try to build SDL_Perl on Mac OS X, and was equally unsuccessful. I sent a detailed report to the mailing list, but didn't receive any reply so far. Seems the project is not very active right now.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://427452]
Approved by Ovid
Front-paged by broquaint
[marto]: I'll be interested to see what difference in terms of file size/quality the new codecs make. I enjoy working on things like this, so that's a bonus
[Corion]: Ah, cool! So it's not an inhouse youtube but for a wider consumption
[marto]: last time it was IE6 clients, now they're on 11, so more scope there also, in terms of UI and playback
[marto]: in house as in Company network, not internet connected (power stations and the corporate HQs)
[Discipulus]: new Monsignor party! free beverages and pizza for all you monks! and a big thanks for the patience you deserved me during these years
[marto]: congrats Discipulus
[Discipulus]: only 4k points to sundial's level ..;=)
[Corion]: Yay Discipulus ;)
[Corion]: marto: Ah, so this will be training videos etc., cool!
[choroba]: Congratulations!

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2017-07-28 09:21 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (425 votes). Check out past polls.