Compiling Games::Irrlicht on Windows
Trag
created: 2004-07-01 10:56:15
Hi monks!

I'm trying to compile Games::Irrlicht for Windows (Activestate Perl) using nmake, Mingw (I read that I should be using a Microsoft compiler for this but I'm hoping I can get away without it since the makefile uses Mingw) and the readme found [http://search.cpan.org/~tels/Games-Irrlicht/README.win32|here]. When I run nmake I get the following output:
g++ -c -nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 
-D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED 
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO 
-DPERL_MSVCRT_READFIX -O2 -DVERSION=\"0.04\"  
-DXS_VERSION=\"0.04\"  "-IC:\Perl\lib\CORE" Irrlicht.c

g++: unrecognized option `-nologo'
g++: unrecognized option `-Gf'
g++: unrecognized option `-Zi'
cc1plus.exe: unrecognized option `-W3'
NMAKE : fatal error U1077: 'C:\WINDOWS\system32\cmd.exe' : return code '0x1'
Stop.
I'd appreciate any help,

Thanks


our @item = reverse (114, 101, 107, 99, 97, 104, 32, 108, 
114, 101, 80, 32, 114, 101, 104, 116, 111, 110, 97, 32, 116, 115, 117, 74); local $my = reverse ")meti@\ ,rhc (pam tnirp";eval $my; 
Re: Compiling Games::Irrlicht on Windows
created: 2004-07-01 11:09:04

The mingw compiler is is getting confused by the microsoft compilers flags - all is not lost however - you can download the VC++ compiler from here.

/J\

Re^2: Compiling Games::Irrlicht on Windows
created: 2004-07-01 11:25:22
I had the VC++ compiler, but the makefile looks for mingw. Do you know how to change the makefile? I have very little experience compiling things.

Thanks

Just another Perl Hack
Re^3: Compiling Games::Irrlicht on Windows
created: 2004-07-01 11:40:22

Did you create the Makefile in the usual way? I.E by running Makefile.PL - it should always get the compiler that the Perl was compiled with (in the ActivatePerl case VC++).

However you could just change the references in the Makefile from 'g++' to 'cl' and that should fix it I would guess.

/J\

Re^4: Compiling Games::Irrlicht on Windows
created: 2004-07-01 11:56:51
I fixed Makefile.pl.win32, then I copied all the .h files from my VC++ distribution into perl\lib\core but it's asking for windows.h now, and I don't seem to have that file. Do you know where I can get it? I ran a search and nothing came up.

Thanks

Just another Perl Hack
Re: Compiling Games::Irrlicht on Windows
created: 2004-07-02 07:40:20
Try the following makefile (you won't get too far though )
use ExtUtils::MakeMaker;

# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.

WriteMakefile(
	'NAME'		=> 'Games::Irrlicht',
	'VERSION_FROM'	=> 'lib/Games/Irrlicht.pm',
	'PREREQ_PM'	=> {
			 Config::Simple => '4.55',
			},
	($] >= 5.005 ?
		(ABSTRACT_FROM  => 'lib/Games/Irrlicht.pm',
                AUTHOR         => 'Tels ') : ()),
	'LIBS'		=> [ '-lIrrlicht -lgdi32 -lglu32 -lopengl32' ], # -ljpeg -lzlib

	'OPTIMIZE'	=> '-O2',
	'DEFINE'	=> ' -GX -TP  ', # e.g., '-DHAVE_SOMETHING'
);

update: After downloading irrlicht-0.6.zip (latest at the moment), and setting up your LIB/INCLUDE/PATH env variables correctly , you need to apply the following patch to Irrlicht.xs

--- Irrlicht.xs.orig	Fri Jul  2 04:11:37 2004
+++ Irrlicht.xs	Fri Jul  2 04:11:48 2004
@@ -1,12 +1,17 @@
-#include "EXTERN.h"
-#include "perl.h"
-#include "XSUB.h"
 
 #include 
 #include 
 #include 
 
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+
+# ifndef WIN32
 struct timespec my_time_spec;
+# endif
 
 /* ************************************************************************ */
 /* our framerate monitor memory */
@@ -229,9 +234,13 @@
       while (to_sleep > 2)
         {
 //	printf ("to_sleep: %i\n", to_sleep);
+# ifdef WIN32
+    Sleep(to_sleep * 1000);
+# else
 	my_time_spec.tv_sec = 0;
 	my_time_spec.tv_nsec = to_sleep * 1000;
 	nanosleep( &my_time_spec, NULL);	// struct timespec *rem);
+# endif
         now = timer->getTime() - base_ticks;
 //	printf ("now: %i\n", now);
         to_sleep = min_time - (now - last);
On your next attempt to compile with MSVS6, you'll be faced with
C:\Perl\.cpanplus\5.8.3\build\Games-Irrlicht-0.04>nmake

Microsoft (R) Program Maintenance Utility   Version 6.00.9782.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

        cl -c    -nologo -Gf -W3 -MD -Zi -DNDEBUG -O1 -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DNO_HASH_SEED -DPE
RL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -O2    -DVERSION=\"0.04\"  -DXS_VERSION=\"0.04\
"  "-IC:\Perl\lib\CORE"  -GX -TP Irrlicht.c
Command line warning D4025 : overriding '/O1' with '/O2'
Irrlicht.c
Irrlicht.xs(69) : error C2555: 'MyEventReceiver::OnEvent' : overriding virtual function differs from 'irr::IEventReceiver:
:OnEvent' only by return type or calling convention
        C:\dev\irrlicht-0.6\include\IEventReceiver.h(168) : see declaration of 'IEventReceiver'
Irrlicht.xs(84) : error C2259: 'MyEventReceiver' : cannot instantiate abstract class due to following members:
        Irrlicht.xs(66) : see declaration of 'MyEventReceiver'
Irrlicht.xs(84) : warning C4259: 'bool __thiscall irr::IEventReceiver::OnEvent(struct irr::SEvent)' : pure virtual functio
n was not defined
        C:\dev\irrlicht-0.6\include\IEventReceiver.h(172) : see declaration of 'OnEvent'
Irrlicht.xs(84) : error C2259: 'MyEventReceiver' : cannot instantiate abstract class due to following members:
        Irrlicht.xs(66) : see declaration of 'MyEventReceiver'
Irrlicht.xs(84) : warning C4259: 'bool __thiscall irr::IEventReceiver::OnEvent(struct irr::SEvent)' : pure virtual functio
n was not defined
        C:\dev\irrlicht-0.6\include\IEventReceiver.h(172) : see declaration of 'OnEvent'
Irrlicht.xs(102) : warning C4800: 'unsigned int' : forcing value to bool 'true' or 'false' (performance warning)
Irrlicht.xs(395) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
NMAKE : fatal error U1077: 'cl' : return code '0x2'
Stop.

which is a bug in the microsoft compiler ([http://support.microsoft.com/default.aspx?scid=kb;EN-US;240862]) and this problem was corrected in Microsoft Visual C++ .NET, so that's what you need (may mean recompiling your perl).

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.

perlmonks.org content © perlmonks.org and gellyfish, PodMaster, Trag

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03