Yesterday I found myself in a position of having to re-master my computer – hence having to reinstall most of the applications including my trusty Cygwin – which always becomes somewhat of a headache when I reach the point of installing DBD::Oracle in it.

This time I got a undefined symbol error. A quick look in Google showed me that Erik Squires had the same exact problem. Lots of searching later, I find that Google can’t find a handy solution anywhere… So I send Erik an email asking about the solution and to my surprise, he answers only 1 (!!) minute after I click send. Talk about a fast reply!!

Hats off to Erik! You will find the solution here:

Hint: the oci.def that he mentions in his post is inside your DBD::Oracle build directory. Don’t get it confused with ocidef.h file in your $ORACLE_HOME/oci/include directory (that’s where I looked first).

I’m adding the error message below with a big SOLUTION header for any Googler out there having the same problem. No need to keep reading if the text above was enough to solve your problem.

Oracle 10g + DBD::Oracle + Cygwin issue

Make error:


cp blib/lib/DBD/
cp blib/lib/
cp dbdimp.h blib/arch/auto/DBD/Oracle/dbdimp.h
cp ocitrace.h blib/arch/auto/DBD/Oracle/ocitrace.h
cp blib/lib/
cp Oracle.h blib/arch/auto/DBD/Oracle/Oracle.h
cp lib/DBD/Oracle/ blib/lib/DBD/Oracle/
cp blib/arch/auto/DBD/Oracle/
/usr/bin/perl.exe -p -e "s/~DRIVER~/Oracle/g" /usr/lib/perl5/site_perl/
-cygwin/auto/DBI/Driver.xst > Oracle.xsi
/usr/bin/perl.exe /usr/lib/perl5/5.10/ExtUtils/xsubpp  -typemap /usr/
.10/ExtUtils/typemap -typemap typemap  Oracle.xs > Oracle.xsc && mv
Oracle.xsc O
gcc -c  -IC:/oracle/product/10.2.0/client_1/oci/include -IC:/oracle/
.0/client_1/rdbms/demo -I/usr/lib/perl5/site_perl/5.10/i686-cygwin/
auto/DBI -DPE
RL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fno-strict-aliasing -pipe -I/usr/
lude -DUSEIMPORTLIB -O3   -DVERSION="1.22" -DXS_VERSION="1.22"  "-
perl5/5.10/i686-cygwin/CORE"  -Wall -Wno-comment -DUTF8_SUPPORT -
gcc -c  -IC:/oracle/product/10.2.0/client_1/oci/include -IC:/oracle/
.0/client_1/rdbms/demo -I/usr/lib/perl5/site_perl/5.10/i686-cygwin/
auto/DBI -DPE
RL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -fno-strict-aliasing -pipe -I/usr/
lude -DUSEIMPORTLIB -O3   -DVERSION="1.22" -DXS_VERSION="1.22"  "-
perl5/5.10/i686-cygwin/CORE"  -Wall -Wno-comment -DUTF8_SUPPORT -
DORA_OCI_VERSION="" dbdimp.c
dbdimp.c: In function `ora_db_login6':
dbdimp.c:450: warning: cast to pointer from integer of different size

{ A bunch more cast and int format warnings from oci8.c}

rm -f blib/arch/auto/DBD/Oracle/Oracle.dll
nt_1/rdbms/lib" g++  --shared  -Wl,--enable-auto-import -Wl,--export-
 -Wl,--stack,8388608 -Wl,--enable-auto-image-base -L/usr/local/lib
Oracle.o dbdi
mp.o oci8.o  -o blib/arch/auto/DBD/Oracle/Oracle.dll    
          /usr/lib/perl5/5.10/i686-cygwin/CORE/libperl.dll.a -L/
5.10.0/build/DBD-Oracle-1.22 -loci      

Oracle.o:Oracle.c:(.text+0x6ba9): undefined reference to
dbdimp.o:dbdimp.c:(.text+0x10e3): undefined reference to
dbdimp.o:dbdimp.c:(.text+0x110f): undefined reference to
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/DBD/Oracle/Oracle.dll] Error 1



Taken from

Thanks to Erik Squires!


undefined reference to `_OCILobGetChunkSize’

Several people helped me with a fix, but this text below is thanks to Jerry Reed. Thanks Jerry!

Please note this problem ONLY occurs under Windows. If you are running Perl under Unix/Linux/MacOS you should be fine.

Jerry Wrote:

The make of DBD Oracle builds an intermediate lib, liboci.a. Functions defined in this lib are somehow culled from the appropriate cygwin distro dll by the line that reads:

system(“dlltool –input-def oci.def –output-lib liboci.a”) at line 235 in Makefile.PL.

But oci.def lacks entries for the two undefined symbols –



(the later is named twice in the linker output).

Strip the leading underscore and insert them into a copy of oci.def. (I inserted them in alpha order, but I do not know if this is really required.)

rm, or use make clean to remove liboci.a and cause it to be rebuilt.

perl Makefile.PL

You should get no unresolved symbols now. You can check that liboci.a now contains the correct entries by:

nm liboci.a | egrep -i ‘(chunk|nls)’


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.