Bloodnok has asked for the wisdom of the Perl Monks concerning the following question:

Hi , I've been struggling to get even the simplest of XS modules to compile on a Windoze machine using the Open Watcom clone of the M$VC compiler as the following error always manifests itself ...
C:\WATCOM\H\direct.h(97): Error! E1034: Symbol 'DIR' already defined C:\WATCOM\H\direct.h(97): Note! 'DIR' defined in C:\Perl\lib\CORE\dire +nt.h(42)
As you can see, there appears to be conflicts between dirent.h (in the perl distribution) and direct.h (in the watcom distribution) ... anyone got any ideas ??

The only man to get his work done by Friday was Robinson Crusoe

Replies are listed 'Best First'.
Re: Compiling XS modules on Windoze
by syphilis (Archbishop) on Jul 18, 2007 at 12:13 UTC
    As a hack, you could try removing the DIR definition from direct.h (the Open Watcom file) and see how that affects things. (Probably best to save a backup copy of any files that you amend.)

    I have no idea whether making that change will lead anywhere useful. My guess is that, even if it fixes the immediate problem, it will probably break something else sooner or later.

    Are you committed to using Open Watcom ? It's a rather uncommon choice of compiler.

    Cheers,
    Rob
      TFT, Rob.

      Sadly, we are currently committed to Open Watcom ... for logistic reasons - we need a solution yesterday and there's a huge (upto 3 month) delay before new software can be installed on the network, hence we've installed Open Watcom locally. We're gambling on the M$VC compatibility of Open Watcom to provide compiled code that will work with ActiveState perl.

      The only person who got his work done by Friday was Robinson Crusoe

        If you're already panicking and denigrating your OS of choice, why not have a look at Strawberry Perl? It includes a supposedly ActiveState compatible Perl and a fitting C compiler. All you need is some fiddling with Config-heavy.pl if you want to install it in a different path than c:\strawberry-perl as is the default.

        We're gambling on the M$VC compatibility of Open Watcom to provide compiled code that will work with ActiveState perl.

        I think that's quite a gamble. The freely available MinGW compiler works well with ActiveState perl. Neither its direct.h nor the direct.h in any of the MSVC compilers that I have define 'DIR'.

        My best instincts tell me that you should dispense with Open Watcom and grab a compiler (preferably either MSVC++ 6.0 or MinGW) that's known to work with ActivePerl and is well supported (wrt ActivePerl).

        I take it you have your own XS modules that you need to compile ? Otherwise you could just make use of the PPM utility to install pre-compiled builds of the CPAN modules.

        Cheers,
        Rob
Re: Compiling XS modules on Windoze
by Trizor (Pilgrim) on Jul 18, 2007 at 15:23 UTC

    If you're fine with using alpha ish stuff as a production base you could check out Strawberry Perl which gets you set up to build XS modules from cpan on windows easily.

    I've only toyed with it myself, never had a need to do any serious Perl on Windows, but goodluck

      Strawberry perl downloaded and in use ... thanx for the tip :-))
Re: Compiling XS modules on Windoze
by leocharre (Priest) on Jul 18, 2007 at 12:52 UTC

    Jeez man- Bite the bullet and get a linux machine on that network. Use gnu gcc, perl.. etc.

    That's what we did when we landed a M$ network. Plugged in some hard core servers and did the dirty work *there*.