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

I am working on windows2000 and have installed active perl from active state.I have to interface my c code with perl. So i use h2xs and run the makefile.pl which creates a makefile. The next step is to nmake it At this step i get an error saying: C:\Perl\lib\CORE\perl.h(382) : fatal error C1083: Cannot open include file: 'sys/types.h': but this file i checked is not present in the sys folder. can anyone tell me the reason for this kind of error and if types.h file is reqd then where can i download it from. These are the basic steps required for interfacing a C/C++ code through perl and b'coz of this error i am not able to proceed further. Any help or advice would be appreciated.
  • Comment on Not able to compile perl modules in windows

Replies are listed 'Best First'.
Re: Not able to compile perl modules in windows
by Corion (Patriarch) on Oct 01, 2005 at 12:14 UTC

    Hello and welcome!

    First a side note - please write full english sentences and words and try to use proper capitalization on words, b'coz its hrd to udst oth'rwz.

    To compile Perl modules for Perl on Win32, you need to have the same compiler that was used to compile your Perl. Usually this means MSVC, at least if you're using ActiveState Perl. You can get half a hint to your compiler from running

    perl -V:cc

    This will tell you what program was used to compile your perl:

    • cl means cl.exe, the C compiler of MSVC
    • cc likely means cc.exe from the Cygwin port or the Msys/MingW port - but if you have one of these perls, likely the suitable C compiler is installed anyway.

    If you have the compiler, you also must set up $ENV{INC} and $ENV{LIB} to the correct values. With MSVC installed, this is the matter of locating and then running vcvars32.cmd in the command window you want to use.

    After that, the errors should disappear.

Re: Not able to compile perl modules in windows
by planetscape (Chancellor) on Oct 02, 2005 at 07:06 UTC