strfry() has asked for the wisdom of the Perl Monks concerning the following question:

hey, i know this isn't a purely perl question, but...
anyone know whats causes this error? (and maybe give me instructions on how to fix it (8 )
<snip>
(m:argv)[luser(/home/luser/perl/test)] ./db.pl DB_File needs compatible versions of libdb & db.h you have db.h version 3.1.17 and libdb version 2.4.14 Compilation failed in require at ./header.cgi line 9. BEGIN failed--compilation aborted at ./common.cgi line 9. Compilation failed in require at ./db.pl line 11.

</snip>
thanks!

Replies are listed 'Best First'.
Re: need help with DB_File
by suaveant (Parson) on May 16, 2001 at 22:47 UTC
    It looks like your db libraries and header files are mismatched versions... what kind of system are you running on?
                    - Ant
      slackware 7.1 "out of the box".. tried to compile db 1.85 but got weird errors ):
        Hmm, I have no expeiernce with slackware, but it really does sound like incompatible libraries, or two different version copies on your system...
                        - Ant
Re: need help with DB_File
by Anonymous Monk on May 17, 2001 at 17:32 UTC
    From the README in DB_File-1.77 from CPAN.
    Incompatible versions of db.h and libdb --------------------------------------- BerkeleyDB seems to have built correctly, but you get an error like th +is when you run the test harness: $ make test PERL_DL_NONLAZY=1 /home/paul/perl/install/bin/perl5.00560 -Iblib/arc +h -Iblib/lib -I/home/paul/perl/install/5.005_60/lib/5.00560/i586-linux -I/home/paul/perl/install/5.005_60/lib/5.00560 -e 'use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t t/db-btree.......... DB_File needs compatible versions of libdb & db.h you have db.h version 2.3.7 and libdb version 2.7.5 BEGIN failed--compilation aborted at t/db-btree.t line 21. ... Another variation on the theme of having two versions of Berkeley DB o +n your system. Solution: Setting the LIB & INCLUDE variables in config.in to point to + the correct directories can sometimes be enough to fix this problem. If that doesn't work the easiest way to fix the problem is to either delete or temporarily rename the copies of db.h and libdb.a that you don't want BerkeleyDB to use. If you are running Linux, please read the Linux Notes sectio +n below.
    so, decide which version you want and then make sure the other ones don't get into the path before it. Brovnik.
Re: need help with DB_File
by strfry() (Monk) on May 17, 2001 at 17:27 UTC
    i figured it out later that day; i was running
    slackware 7.1 current (as opposed to stable)...
    here's what they had to say in the Changelog:
    Tue Feb 20 14:10:32 PST 2001 d1/perl.tgz: Recompiled without -lndbm to fix DB_File module. Thanks to Toshikazu Yoshikawa for posting a problem report and fix.

    since my copy was outdated, all i had to do was recompile perl (!!5.6.1!!) and remember not to flip that switch (8

    many thanks to Ant and everyone else out there who helped me out.