Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Installing DB_File on Windows

by Gangabass (Vicar)
on Oct 05, 2009 at 05:09 UTC ( #799162=perlquestion: print w/replies, xml ) Need Help??
Gangabass has asked for the wisdom of the Perl Monks concerning the following question:

I have problem installing DB_File on my Windows box (Windows 7, ActiveState perl version 5.10).

This thread on ActiveState site tell me that: <quote>build of DB_File on all platforms except 5.10 for Linux-64 bit is blocked</quote>.

I have downloaded and installed Berkeley DB from Oracle site (db-4.8.24.msi). And after that i have tried to install DB_File from CPAN. Here is result:

Microsoft Windows [Version 6.1.7600] (c) C:\Users\roman.2GIS>perl -MCPAN -e "shell" Set up gcc environment - 3.4.5 (mingw-vista special r3) cpan shell -- CPAN exploration and modules installation (v1.9402) Enter 'h' for help. cpan> install DB_File Fetching with LWP: Going to read 'C:\Perl\cpan\sources\authors\01mailrc.txt.gz' ...................................................................... +......DONE Fetching with LWP: Going to read 'C:\Perl\cpan\sources\modules\02packages.details.txt.gz' Database was generated on Sat, 03 Oct 2009 08:27:42 GMT ...................................................................... +......DONE Fetching with LWP: Going to read 'C:\Perl\cpan\sources\modules\' ...................................................................... +......DONE Going to write C:\Perl\cpan\Metadata Running install for module 'DB_File' Running make for P/PM/PMQS/DB_File-1.820.tar.gz Fetching with LWP: +ar.gz Fetching with LWP: Checksum for C:\Perl\cpan\sources\authors\id\P\PM\PMQS\DB_File-1.820.t +ar.gz ok Scanning cache C:\Perl/cpan/build for sizes DONE DB_File-1.820/ DB_File-1.820/MANIFEST DB_File-1.820/Changes DB_File-1.820/ DB_File-1.820/DB_File_BS DB_File-1.820/ DB_File-1.820/ppport.h DB_File-1.820/DB_File.xs DB_File-1.820/t/ DB_File-1.820/t/db-recno.t DB_File-1.820/t/pod.t DB_File-1.820/t/db-hash.t DB_File-1.820/t/db-btree.t DB_File-1.820/version.c DB_File-1.820/fallback.h DB_File-1.820/fallback.xs DB_File-1.820/README DB_File-1.820/dbinfo DB_File-1.820/patches/ DB_File-1.820/patches/5.004 DB_File-1.820/patches/5.005_01 DB_File-1.820/patches/5.6.0 DB_File-1.820/patches/5.005_03 DB_File-1.820/patches/5.004_05 DB_File-1.820/patches/5.004_04 DB_File-1.820/patches/5.004_01 DB_File-1.820/patches/5.004_03 DB_File-1.820/patches/5.005 DB_File-1.820/patches/5.004_02 DB_File-1.820/patches/5.005_02 DB_File-1.820/META.yml DB_File-1.820/typemap DB_File-1.820/hints/ DB_File-1.820/hints/ DB_File-1.820/hints/ DB_File-1.820/Makefile.PL Going to build P/PM/PMQS/DB_File-1.820.tar.gz Set up gcc environment - 3.4.5 (mingw-vista special r3) Parsing Looks Good. Checking if your kit is complete... Looks good Note (probably harmless): No library found for -ldb Writing Makefile for DB_File cp blib\lib\ AutoSplitting blib\lib\ (blib\lib\auto\DB_File) C:/Perl/site/bin/gcc.exe -c -I/usr/local/BerkeleyDB/include -DNDEB +UG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPRIVLI +B_LAST_IN_ INC -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MS +VCRT_READF IX -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields -O2 -DVE +RSION=\"1. 820\" -DXS_VERSION=\"1.82\" "-IC:\Perl\lib\CORE" -D_NOT_CORE -DmD +B_Prefix_t =size_t -DmDB_Hash_t=u_int32_t version.c version.c:30:16: db.h: No such file or directory dmake.exe: Error code 129, while making 'version.o' PMQS/DB_File-1.820.tar.gz C:\Perl\site\bin\dmake.exe -- NOT OK Running make test Can't test without successful make Running make install Make had returned bad status, install seems impossible Failed during this command: PMQS/DB_File-1.820.tar.gz : make NO cpan>

I'm sure the problem is on this line: Note (probably harmless): No library found for -ldb. But how i can resolve this issue?

Replies are listed 'Best First'.
Re: Installing DB_File on Windows
by Anonymous Monk on Oct 05, 2009 at 07:31 UTC

      I think you're right but i can't find libdb.a file on my system. db.h header file is there but i have full install of Berkeley DB and check whole disk for libdb.a with no result.

        I think you're right but i can't find libdb.a file on my system

        It's quite possible that the import lib that shipped with the msi package that you installed had a different name - eg is there a 'db.lib' ? If you can identify the import lib (irrespective of the name it has), then simply create a copy of it called 'libdb.a' in a location where it will be found, and MinGW should have no trouble linking to it.

        Once that warning about Note (probably harmless): No library found for -ldb goes away, you're a chance to succeed.

        Where did you install it?

        What I did last time was download zip version, unzip, start msys and

        cd db-4.7.25/build_unix sh ../dist/configure make
        Then switch back to cmd.exe
        cd ../perl/DB_File perl -pi.orig -e "s!^(INCLUDE|LIB)\s.*!$1\t= ../../build_unix/!" confi perl Makefile.PL dmake test dmake install
Re: Installing DB_File on Windows
by Anonymous Monk on Oct 13, 2009 at 06:52 UTC
    Set the Berkeley DB lib and inc path appropriately in
Re: Installing DB_File on Windows
by Anonymous Monk on Jan 19, 2010 at 10:36 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://799162]
Approved by ELISHEVA
[Corion]: Hmm - no, that outputs 1 for me on 5.14 - perl -wle "my $x = qq(\x{200b}); warn $x; warn length $x"
[hippo]: Smart - I'll give that a go. Thanks.
[hippo]: Ah
[Corion]: But maybe there is some other Unicode string that will be true but have a zero width
[hippo]: For explanation, I've seen this construct in someone else's code (no names, no pack drill) and couldn't think of a situation to trigger it.
[Corion]: You'll have to look somewhere esoteric for that. Maybe some tied variable or special dualvar can also trigger that. But it's certainly not a common occurrence
[Corion]: And on 5.20, the following also outputs no find:perl -wle 'for my $x ("\x{2000}".."\ x{1fffff}") { if( $x && ! length $x ) { warn qq(<$x>); warn length $x; die } }'
[Corion]: (this time on Unix)
[hippo]: Understood. I'll have to go through the code and see if it's doing anything fancy with ties, dual-vars or non-scalars. In the end, it's probably a bug though.

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (14)
As of 2017-07-27 13:34 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (413 votes). Check out past polls.