Reputation: 5971
I used to use MinGW for compiling cpan modules. Now on my new computer i installed VisualStudio and CPAN now tries to to use the vs-compiler and fails because it can't find "sys/types.h".
How do I tell cpan to use MinGW? I couldn't find a commoand-line option for this. Can i fix the problem otherise using vs-compiler? Where would I put sys/types.h? How do I pass the include command from cpan to the compiler?
Upvotes: 1
Views: 738
Reputation: 33658
If you're trying to compile CPAN modules with a different C compiler than your Perl was built with, you're asking for trouble. The typical Perl module with XS code uses the compiler flags from your Perl config (see perl -V
). Since ActivePerl is built with MSVC, $Config{ccflags}
contains MSVC-specific flags which won't work with MinGW's gcc.
So if you use ActivePerl, you should stick with MSVC. If you want to use MinGW, switch to Strawberry Perl.
That said, sys/types.h
is a POSIX header. If your module needs it, it probably doesn't support Windows regardless of the compiler you use. In that case, you can only switch to Cygwin which emulates a POSIX environment.
MSVC should come with sys/types.h
. You probably didn't set it up correctly. Did you run vcvars.bat
?
If you tell us which module you're trying to install, you might get a better answer.
Upvotes: 3