I've been trying to build the latest snapshot of SDL_perl using Visual Studio 6 and 
ActiveState Perl 5.8.0.  Not having much luck, but I've made a little progress.

As chromatic noted, Build::SDL::Win32 was originally missing.  With the newest 
snapshot he uploaded, I found that Build::SDL::Win32::subsystems() and 
Build::SDL::Win32::libraries() were not returning the correct thing.  Adding return 
$subsystems; or return $libraries; as appropriate (which chromatic has informed me he 
corrected in the snapshot), I got the error: Unknown library 'opengl32' for 'OpenGL'

I was able to correct this by changing:
        return [qw( opengl32 glu32 )];
in Build::SDL::Win32::ms_gl_subsystems() to:
        return [qw( OpenGL GLU )];

Then, I got the following errors:

Use of uninitialized value in substitution (s///) at build_lib/SDL\Build\MSWin32.pm 
line 23.
Use of uninitialized value in concatenation (.) or string at 
C:/Perl/lib/File/Spec/Win32.pm line 102.
Use of uninitialized value in concatenation (.) or string at 
C:/Perl/lib/File/Spec/Win32.pm line 102.
Use of uninitialized value in concatenation (.) or string at 
C:/Perl/lib/File/Spec/Win32.pm line 102.
Use of uninitialized value in concatenation (.) or string at 
C:/Perl/lib/File/Spec/Win32.pm line 102.
Use of uninitialized value in concatenation (.) or string at 
C:/Perl/lib/File/Spec/Win32.pm line 102.
Use of uninitialized value in hash element at build_lib/SDL/Build.pm line 210.
Use of uninitialized value in hash element at build_lib/SDL/Build.pm line 210.
Checking whether your kit is complete...
Looks good
'sdl-config' is not recognized as an internal or external command,
operable program or batch file.
sdl-config does not appear to be in your path.
Please check your config and try again.

I got rid of the uninitialized value errors by adding the line:
        $libraries->{OpenGL}{header} = 'gl.h';
to Build::SDL::Win32::libraries(), and I got rid of the sdl-config error by changing 
the error (in compile_flags() and link_flags() in build_lib\SDL\Build.pm) to:
        if($^O !~ /win32/i and $? >> 8) {
          die "sdl-config does not appear to be in your path.\n" .
                  "Please check your config and try again.\n";
        }

That got me:
Checking whether your kit is complete...
Looks good
'sdl-config' is not recognized as an internal or external command,
operable program or batch file.
Can't use an undefined value as an ARRAY reference at build_lib/SDL/Build.pm line 245.

Turns out that $includes->{$subsystem} and $defines->{$subsystem} were both empty, so 
I changed the appropriate lines in set_flags() to:
                                @{ $includes->{$subsystem} || [] },

I also changed the extra_linker_flags similarly, just in case.  This let Build.PL run 
and create Build.  Running Build, I got:
lib\SDL\Console.pm -> blib\lib\SDL\Console.pm
lib\SDL\Event.pm -> blib\lib\SDL\Event.pm
lib\SDL\Tutorial\Images.pm -> blib\lib\SDL\Tutorial\Images.pm
lib\SDL_perl.pm -> blib\lib\SDL_perl.pm
lib\SDL\Cursor.pm -> blib\lib\SDL\Cursor.pm
lib\SDL\FontTool.pm -> blib\lib\SDL\FontTool.pm
lib\SDL\Shell.pm -> blib\lib\SDL\Shell.pm
lib\SDL\Font.pm -> blib\lib\SDL\Font.pm
lib\SDL\OpenGL\Model.pm -> blib\lib\SDL\OpenGL\Model.pm
lib\SDL\Tutorial\Drawing.pm -> blib\lib\SDL\Tutorial\Drawing.pm
lib\SDL\Cdrom.pm -> blib\lib\SDL\Cdrom.pm
lib\SDL\Config.pm -> blib\lib\SDL\Config.pm
lib\SDL\Timer.pm -> blib\lib\SDL\Timer.pm
lib\SDL.pm -> blib\lib\SDL.pm
lib\SDL\Color.pm -> blib\lib\SDL\Color.pm
lib\SDL\Rect.pm -> blib\lib\SDL\Rect.pm
lib\SDL\Music.pm -> blib\lib\SDL\Music.pm
lib\SDL\Constants.pm -> blib\lib\SDL\Constants.pm
lib\SDL\OpenGL\Cube.pm -> blib\lib\SDL\OpenGL\Cube.pm
lib\SDL\GraphicTool.pm -> blib\lib\SDL\GraphicTool.pm
lib\SDL\Tutorial.pm -> blib\lib\SDL\Tutorial.pm
lib\SDL\Sound.pm -> blib\lib\SDL\Sound.pm
lib\SDL\OpenGL\Constants.pm -> blib\lib\SDL\OpenGL\Constants.pm
lib\SDL\Mixer.pm -> blib\lib\SDL\Mixer.pm
lib\SDL\OpenGL.pm -> blib\lib\SDL\OpenGL.pm
lib\SDL\Tutorial\Animation.pm -> blib\lib\SDL\Tutorial\Animation.pm
lib\SDL\Surface.pm -> blib\lib\SDL\Surface.pm
lib\SDL\TTFont.pm -> blib\lib\SDL\TTFont.pm
lib\SDL\App.pm -> blib\lib\SDL\App.pm
lib\SDL\Palette.pm -> blib\lib\SDL\Palette.pm
src\SDL.xs -> src\SDL_perl.xs
src\SDL_perl.xs -> src\SDL_perl.c
C:\Perl\bin\perl.exe "-IC:\Perl\lib" "-IC:\Perl\lib" "C:\Perl\lib\ExtUtils\xsubp
p" -noprototypes -typemap "C:\Perl\lib\ExtUtils\typemap" "src\SDL_perl.xs"Genera
ting script 'src\SDL_perl.ccs'
cl -nologo -c @"src\SDL_perl.ccs" -Fo"src\SDL_perl.obj" "src\SDL_perl.c"
SDL_perl.c
SDL_perl.xs(621) : warning C4244: '=' : conversion from 'unsigned short ' to 'un
signed char ', possible loss of data
SDL_perl.xs(1122) : warning C4244: '=' : conversion from 'long ' to 'short ', po
ssible loss of data
SDL_perl.xs(1131) : warning C4244: '=' : conversion from 'long ' to 'short ', po
ssible loss of data
SDL_perl.xs(1140) : warning C4244: '=' : conversion from 'long ' to 'unsigned sh
ort ', possible loss of data
SDL_perl.xs(1149) : warning C4244: '=' : conversion from 'long ' to 'unsigned sh
ort ', possible loss of data
SDL_perl.xs(1192) : warning C4244: '=' : conversion from 'long ' to 'unsigned ch
ar ', possible loss of data
SDL_perl.xs(1201) : warning C4244: '=' : conversion from 'long ' to 'unsigned ch
ar ', possible loss of data
SDL_perl.xs(1210) : warning C4244: '=' : conversion from 'long ' to 'unsigned ch
ar ', possible loss of data
SDL_perl.xs(1247) : warning C4244: '=' : conversion from 'unsigned long ' to 'un
signed char ', possible loss of data
SDL_perl.xs(1248) : warning C4244: '=' : conversion from 'unsigned long ' to 'un
signed char ', possible loss of data
SDL_perl.xs(1249) : warning C4244: '=' : conversion from 'unsigned long ' to 'un
signed char ', possible loss of data
SDL_perl.xs(2326) : warning C4244: '=' : conversion from 'short ' to 'unsigned c
har ', possible loss of data
ExtUtils::Mkbootstrap::Mkbootstrap('src\SDL_perl')
Use of uninitialized value in substitution (s///) at C:\Perl\site\lib/Module/Bui
ld/Platform/Windows.pm line 139.
Use of uninitialized value in concatenation (.) or string at C:\Perl\site\lib/Mo
dule/Build/Platform/Windows.pm line 147.
Use of uninitialized value in concatenation (.) or string at C:\Perl\site\lib/Mo
dule/Build/Platform/Windows.pm line 149.
Use of uninitialized value in concatenation (.) or string at C:\Perl\site\lib/Mo
dule/Build/Platform/Windows.pm line 151.
Use of uninitialized value in concatenation (.) or string at C:\Perl\site\lib/Mo
dule/Build/Platform/Windows.pm line 153.
ExtUtils::Mksymlists::Mksymlists('src\SDL_perl')
Use of uninitialized value in anonymous hash ({}) at C:\Perl\lib/ExtUtils/Mksyml
ists.pm line 29.
Use of uninitialized value in concatenation (.) or string at C:\Perl\site\lib/Mo
dule/Build/Platform/Windows.pm line 336.
Generating script 'src\.lds'
link @"src\.lds" -out:"blib\arch\auto\SDL_perl\SDL_perl.dll"
LINK : fatal error LNK1104: cannot open file "src\.def"
LINK : fatal error LNK1141: failure during build of exports file
src\OpenGL.xs -> src\SDL\OpenGL.xs
src\SDL\OpenGL.xs -> src\SDL\OpenGL.c
C:\Perl\bin\perl.exe "-IC:\Perl\lib" "-IC:\Perl\lib" "C:\Perl\lib\ExtUtils\xsubp
p" -noprototypes -typemap "C:\Perl\lib\ExtUtils\typemap" "src\SDL\OpenGL.xs"Gene
rating script 'src\SDL\OpenGL.ccs'
cl -nologo -c @"src\SDL\OpenGL.ccs" -Fo"src\SDL\OpenGL.obj" "src\SDL\OpenGL.c"
OpenGL.c
OpenGL.xs(35) : error C2146: syntax error : missing ')' before identifier 'error
Code'
OpenGL.xs(35) : error C2061: syntax error : identifier 'errorCode'
OpenGL.xs(35) : error C2059: syntax error : ';'
OpenGL.xs(35) : error C2059: syntax error : ')'
OpenGL.xs(36) : error C2449: found '{' at file scope (missing function header?)
OpenGL.xs(51) : error C2059: syntax error : '}'
OpenGL.xs(76) : error C2143: syntax error : missing ')' before '*'
OpenGL.xs(76) : error C2143: syntax error : missing '{' before '*'
OpenGL.xs(76) : error C2059: syntax error : 'type'
OpenGL.xs(76) : error C2059: syntax error : ')'
OpenGL.xs(127) : error C2065: 'GLU_TESS_BEGIN' : undeclared identifier
OpenGL.xs(138) : error C2146: syntax error : missing ')' before identifier 'type
'
OpenGL.xs(138) : error C2061: syntax error : identifier 'type'
OpenGL.xs(138) : error C2059: syntax error : ';'
OpenGL.xs(138) : error C2059: syntax error : ','
OpenGL.xs(138) : error C2059: syntax error : ')'
OpenGL.xs(161) : error C2146: syntax error : missing ')' before identifier 'type
'
OpenGL.xs(161) : error C2061: syntax error : identifier 'type'
OpenGL.xs(161) : error C2059: syntax error : ';'
OpenGL.xs(161) : error C2059: syntax error : ','
OpenGL.xs(161) : error C2059: syntax error : ')'
OpenGL.xs(184) : error C2146: syntax error : missing ')' before identifier 'flag
'
OpenGL.xs(184) : error C2061: syntax error : identifier 'flag'
OpenGL.xs(184) : error C2059: syntax error : ';'
OpenGL.xs(184) : error C2059: syntax error : ','
OpenGL.xs(184) : error C2059: syntax error : ')'
OpenGL.xs(218) : error C2065: 'GLU_TESS_VERTEX' : undeclared identifier
OpenGL.xs(235) : error C2146: syntax error : missing ')' before identifier 'coor
ds'
OpenGL.xs(235) : error C2061: syntax error : identifier 'coords'
OpenGL.xs(235) : error C2059: syntax error : ';'
OpenGL.xs(235) : error C2059: syntax error : '['
OpenGL.xs(236) : error C2059: syntax error : ')'
error building dll file from 'src\SDL\OpenGL.c' at C:\Perl\site\lib/Module/Build
/Platform/Windows.pm line 106.

Oh, also SDL_perl.xs seems to #include <SDL.h>, while OpenGL.xs uses #include 
<SDL/SDL.h>.  I worked around this by making two copies of the header files, but I 
imagine it would be better for them to look in the same place (unless, of course, I'm 
missing something?)

In case it's important, I've set the following environment variables:
  set INCLUDE=C:\Program Files\SDL-1.2.7\include;%INCLUDE%
  set PATH=C:\Program Files\SDL-1.2.7\lib;%PATH%
  set LIBS=C:\Program Files\SDL-1.2.7\lib;%LIBS%

That's where I'm stuck.  Apparently, HAVE_GL isn't being defined for OpenGL.xs, but 
I'm not sure why.  Any help would be appreciated.

Thanks,
bbfu
Cory Johns

Reply via email to