Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

DBD:Mysql compilation failed on windows

by pesubbia (Novice)
on Mar 11, 2022 at 06:04 UTC ( [id://11141991]=perlquestion: print w/replies, xml ) Need Help??

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

Hi Team, We are compiling the DBD::MariaDB and DBD::mysql packages on windows. S/w's Using perl5.24.1 and VC++ 2015.
Arguments :
perl Makefile.PL --cflags=-IC:\mysql\include --libs="-LC:\mysql\lib -lmysqlclient" --testdb=vms --testuser=root --testpassword=cisco@123 --testhost=127.0.0.1 --testport=3306
Problem statement :
Cannot find the file 'mariadb_config' nor 'mysql_config'! Your execution PATH doesn't seem not contain the path to mariadb_config or mysql_config. Resorting to guessed values! : Checking if libs and header files are available for compiling... Can't link/include C library 'windows.h', 'winsock.h', 'mysql.h', 'mysqlclient', aborting. As i compiled DBI same issue. Not sure what is the expectation i am missing here. Kindly help I searched many does resolved the issue. And where can i get the above config files. Thanks, Anitha.S
  • Comment on DBD:Mysql compilation failed on windows

Replies are listed 'Best First'.
Re: DBD:Mysql compilation failed on windows
by syphilis (Archbishop) on Mar 11, 2022 at 08:19 UTC
    There's plenty of PASS reports for DBD::MariaDB from cpantesters running Windows, though they're probably all using mimgw-w64 ports of gcc instead of VS 2015.
    First up, can you provide the output of running perl -V (that's an upper case "V") on your perl-5.24.1 ?

    Update: I found that DBD::MariaDB (version 1.21) installed straight out of the box on my Strawberry Perl-5.24.1 (64 bit).
    That particular build of Strawberry Perl shipped with DBI-1.636 and DBD-mysql-4.041.

    Cheers,
    Rob
      Hi Rob ,
      Thanks for the immediate reply. Here is the output of perl -V
      perl -V Summary of my perl5 (revision 5 version 24 subversion 1) configuration +: Platform: osname=MSWin32, osvers=5.2, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -GL -DWIN3 +2 -D_CONSOLE -DNO_STRICT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO +_DEPRECATE -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IM +PLICIT_SYS', optimize='-O1 -MD -Zi -DNDEBUG -GL', cppflags='-DWIN32' ccversion='15.00.30729.01', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234, do +ublekind=3 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8, + longdblkind=0 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64 +', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -lt +cg -libpath:"c:\perl-5241\lib\CORE" -machine:x86' libpth=\lib libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib +comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi3 +2.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib o +dbccp32.lib comctl32.lib msvcrt.lib perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.l +ib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib net +api32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.l +ib odbccp32.lib comctl32.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl524.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt: +ref,icf -ltcg -libpath:"c:\perl-5241\lib\CORE" -machine:x86' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_ITHREA +DS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE +_TIME USE_PERLIO USE_PERL_ATOF Built under MSWin32 Compiled at Jun 30 2017 03:50:01 %ENV: PERL5LIB="c:\perl-5241\lib;c:\perl-5241\site\lib;C:\PROGRA~2\CSCOp +x\lib" @INC: c:\perl-5241\lib c:\perl-5241\site\lib C:\PROGRA~2\CSCOpx\lib c:/perl-5241/site/lib c:/perl-5241/lib .
        Hmmm ... I think that perl was built using an older MS compiler.
        However, I'm inclined to think that shouldn't matter, and it's certainly appropriate to be using an MS compiler to build modules for that perl build that you have.
        How did you try to build DBD::MariaDB ? A normal way would have been to run cpan -i DBD::MariaDB .

        The error message you posted in your original post doesn't provide anything meaningful to me. It's very strange that the standard Windows headers windows.h and winsock.h (included with every MS compiler) could not be found.
        Did you run the VC++ batch file that sets up the environment such that these headers are found by default ?

        Or perhaps the problem is just some stupid checks that the DBD::MariaDB Makefile.PL wants to run. (I haven't looked.)
        Sorry - I don't mess much with VC++ builds of perl any more, and I don't mess with DBD/DBI modules at all.
        If I needed to get this done, I'd just grab one of the "Portable" Strawberry Perl builds from https://strawberryperl.com/releases.html, as that seems so simple and straightforward.

        Cheers,
        Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11141991]
Approved by marto
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-26 05:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found