in reply to Re^3: DBD:Mysql compilation failed on windows
in thread DBD:Mysql compilation failed on windows

Rob,
Finally the compile picked the dmake and after that final execution f +ailed with the following. Kindly help. Generating a dmake-style Makefile Writing Makefile for Mock::Config Writing MYMETA.yml and MYMETA.json RURBAN/Mock-Config-0.03.tar.gz C:\Perl\bin\perl.exe Makefile.PL -- OK Running make for R/RU/RURBAN/Mock-Config-0.03.tar.gz Microsoft (R) Program Maintenance Utility Version 14.00.24210.0 Copyright (C) Microsoft Corporation. All rights reserved. Recompile perl with -DDEBUGGING to use -D switch (did you mean -d ?) Recompile perl with -DDEBUGGING to use -D switch (did you mean -d ?) Recompile perl with -DDEBUGGING to use -D switch (did you mean -d ?) Recompile perl with -DDEBUGGING to use -D switch (did you mean -d ?) Recompile perl with -DDEBUGGING to use -D switch (did you mean -d ?) Recompile perl with -DDEBUGGING to use -D switch (did you mean -d ?) to undefined at C:\perl\lib/ExtUtils/Install.pm line 1198. NMAKE : fatal error U1077: 'C:\Perl\bin\perl.exe' : return code '0x2' Stop. RURBAN/Mock-Config-0.03.tar.gz "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.EX +E" -- NOT OK

Replies are listed 'Best First'.
Re^5: DBD:Mysql compilation failed on windows
by syphilis (Archbishop) on Mar 17, 2022 at 11:04 UTC
    You have somehow managed to generate a Makefile written for dmake ... but then that Makefile gets processed by nmake, and nmake doesn't understand Makefiles that were written for dmake.

    You have a perl that specifies that perl -V:cc is cl and that perl -V:make is nmake. If you wish to use a mingw compiler to build a DBD module for that perl then the first thing you must do is to install ExtUtils::FakeConfig. And the second thing you must do is to set PER5OPT=-MConfig_m set PERL5OPT=-MConfig_m (Thanks to hv for the correction.)
    Next you check that perl -V:make reports dmake and that perl -V:cc reports gcc. (If that's not happening, then something is not right.)
    Then you have a chance of success ... or we'll at least start seeing helpful error messages. I know this is something that can work.

    I actually think that if you were to instead use your MS compiler && provide correct command line arguments to the perl Makefile.PL ... command, then you might achieve what you want. But I don't know if this is something that can work.

    In my opinion, the simplest solution is to just install one of the later "portable" editions of Strawberry Perl, where both DBD::MySQL and DBD::MariaDB are already installed, and can be updated using the cpan command if an upgrade of those modules is needed.
    This is also something that can work.

    Cheers,
    Rob