in reply to Re^2: Problem Compiling under Solaris using DBI and DBD::DB2
in thread Problem Compiling under Solaris using DBI and DBD::DB2

Note (probably harmless): No library found for -ldb2

This is most likely the problem (note that although it says "probably harmless", it definitely isn't, as this is the essential library here).

When you see this message, the respective link instruction is removed from the list, which means the Perl binding .../DBD/DB2/DB2.so won't be linked against the library — resulting in the "symbol not found" error later at dynamic link time.

In case you're sure you do have the right library in the specified place (/home/db2inst1/lib), the pragmatic way to resolve the issue (instead of trying to figure out why the above MakeMaker check failed) would be to manually rerun the final link command with the appropriate link instruction added, i.e. (from within the build directory)

gcc -G DB2.o dbdimp.o -o blib/arch/auto/DBD/DB2/DB2.so -L/home/db2 +inst1/lib -ldb2 ^^^^^^^^^^ +^^^^^^^^^^^^^^^

(if you get an error, you don't have the right library)

Then run make test && make install, as usual.

Replies are listed 'Best First'.
Re^4: Problem Compiling under Solaris using DBI and DBD::DB2
by Anonymous Monk on Jan 14, 2012 at 06:23 UTC

      I think you meant to link "Fixing MakeMaker" to node 944371.

      "Believe me, Mike, I calculated the odds of this succeeding against the odds I was doing something incredibly stupid… and I went ahead anyway." (Crow in "MST3K The Movie")
Re^4: Problem Compiling under Solaris using DBI and DBD::DB2
by palaxos (Initiate) on Jan 18, 2012 at 14:21 UTC
    Hi, Thanks again for your quick reply!

    I ran that gcc line and I indeed got an error.

    ld: fatal: file /home/db2inst1/sqllib/lib/libdb2.so: wrong ELF class: +ELFCLASS64

    After researching that a bit, i beleive i'm using the wrong version of the DB2 client (64 bits). I checked my perl version and it looks 32 bits, so i'll install DB2 (32 bits) and then i'll give you all some feedback on how it went.