4

I am trying to install a CPAN package (Apache::MP3), for which it requires a number of prerequisites including mod_perl-2.0.11 on Perl and Apache. According to previous question / answer, I may need Visual Studio (both previously compiled using VS) in order to even compile mod_perl module. Which doesn't make sense if perl is included with XAMPP.

But before I got to this point, I had to install dmake (C:\xampp\c\bin\dmake.exe) which I downloaded from CPAN, and extracted myself by placing it into the xampp directory in ...\c\bin... I also downloaded apxs.bat and placed it inside the xampp\apache\bin directory. Next I required a gcc compiler to build the library / modules according to previous errors.

I am now trying to follow the list of errors as I getting them, in order to be successful with the project. The original module (Apache::MP3) isn't important, as I just wanted to be sure that Perl worked in XAMPP. I can in fact use it as a cgi, but the mod_perl is not included with the installation.

The problem I am having is while trying to build while using gcc first with cygwin (which I placed all inside my PATH) ...

\xampp\perl\lib\CORE/win32.h:106:10: fatal error: direct.h: No such file or directory
  106 | #include <direct.h>
      |          ^~~~~~~~~~
compilation terminated.
dmake:  Error code 129, while making 'mod_perl.lo'
dmake.exe:  Error code 255, while making 'modperl_lib'

and then with C:\MinGW\bin, I am getting this error message ...

C:\xampp\apache\include/http_log.h:37:10: fatal error: syslog.h: No such file or directory
37 | #include <syslog.h>
      |          ^~~~~~~~~~
compilation terminated. dmake:  Error code 129, while making 'mod_perl.lo'
dmake.exe:  Error code 255, while making 'modperl_lib'

This error has to do with the compiler and access to its built-in headers that have to do with windows. I tried adding the libraries directory to the PATH (restarted cmd.exe) as well, which had 0 effect. The next thing I might have to do is actually open the Makefile.PL and append the parameters to tell gcc where to find its own header files. Would I be better off installing each component and getting a copy of VS compiler?

Barry Dick
  • 161
  • 3
  • 16
  • *"According to previous question / answer, I may need Visual Studio"* : Which question are you referring to here? – Håkon Hægland Jul 01 '20 at 13:52
  • *"The problem I am having is while trying to build while using gcc first with cygwin"* What exactly are you trying to build and why are you using cygwin? What version of `perl` are you using? – Håkon Hægland Jul 01 '20 at 13:55
  • I think `dmake` is not supported anymore, see [Why will it not install DBI?](https://stackoverflow.com/q/59477263/2173773). Maybe you could try use Strawberry perl and `gmake` ? – Håkon Hægland Jul 01 '20 at 14:01
  • The question has to do with the one I made in the Title. Everything else is how I got to that point. I am using Perl (v5.16.3) built for MSWin32-x64-multi-thread. Again how do I instruct gcc to compile the necessary header files that come with it? – Barry Dick Jul 01 '20 at 17:44
  • If perl module require compilation from source code (other programming languages involved C/C++/etc.) then you will require all development tool chain including some systems include files (header files). Without development tools, required libraries and header files compilation will fail. It is much easier in Linux than in Windows. – Polar Bear Jul 01 '20 at 19:30
  • If I had to use Windows for mod_perl I would have tried WSL first. Which is Linux inside Windows. Probably the Ubuntu variant of it. If that doesn't work, I would have tried with Cygwin. And only then DMAKE+MinGW if also Cygwin didn't work. – Kjetil S. Jul 02 '20 at 01:06

0 Answers0