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

Monks,
I am getting this error during compiling oracle package, can you guys take a look at it.
Here are the variables I have set :
<> 57: echo $LD_LIBRARY_PATH /apps/oracli/DSM/9.2.0/lib:/var/tmp/faptdt/mylib <> 58: echo $ORACLE_HOME /apps/oracli/DSM/9.2.0 <> 59: pwd /var/tmp/MyPerl/packages/DBD-Oracle-1.18 <> 60: make Skip blib/lib/DBD/Oracle.pm (unchanged) Skip blib/lib/DBD/mkta.pl (unchanged) Skip blib/lib/oraperl.ph (unchanged) Skip blib/arch/auto/DBD/Oracle/dbdimp.h (unchanged) Skip blib/arch/auto/DBD/Oracle/ocitrace.h (unchanged) Skip blib/lib/Oraperl.pm (unchanged) Skip blib/arch/auto/DBD/Oracle/Oracle.h (unchanged) Skip blib/arch/auto/DBD/Oracle/mk.pm (unchanged) Skip blib/lib/DBD/Oracle/GetInfo.pm (unchanged) cc -c -I/apps/oracli/DSM/9.2.0/rdbms/public -I/apps/oracli/DSM/9.2.0/ +rdbms/demo -I/apps/oracli/DSM/9.2.0/rdbms/demo -I/apps/oracli/DSM/9.2 +.0/rdbms/public -I/apps/oracli/DSM/9.2.0/plsql/public -I/apps/oracli/ +DSM/9.2.0/network/public -I/var/tmp/Perl/lib/site_perl/5.8.8/sun4-sol +aris-thread-multi/auto/DBI -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT - +DUSE_SITECUSTOMIZE -DNO_HASH_SEED -D_LARGEFILE_SOURCE -D_FILE_OFFSET_ +BITS=64 -O -DVERSION=\"1.18\" -DXS_VERSION=\"1.18\" -KPIC "-I/var +/tmp/Perl/lib/5.8.8/sun4-solaris-thread-multi/CORE" -DUTF8_SUPPORT - +DNEW_OCI_INIT -DORA_OCI_VERSION=\"9.2.0.1\" Oracle.c "/apps/oracli/DSM/9.2.0/rdbms/demo/ort.h", line 927: warning: paramete +r has incomplete type: tdo "/apps/oracli/DSM/9.2.0/rdbms/demo/ort.h", line 1042: warning: paramet +er has incomplete type: type_ref "/apps/oracli/DSM/9.2.0/rdbms/demo/ort.h", line 1044: warning: paramet +er has incomplete type: tdo "/apps/oracli/DSM/9.2.0/rdbms/demo/ociap.h", line 6338: warning: param +eter has incomplete type: hndl "/apps/oracli/DSM/9.2.0/rdbms/demo/ociap.h", line 6556: warning: param +eter has incomplete type: argv cc -c -I/apps/oracli/DSM/9.2.0/rdbms/public -I/apps/oracli/DSM/9.2.0/ +rdbms/demo -I/apps/oracli/DSM/9.2.0/rdbms/demo -I/apps/oracli/DSM/9.2 +.0/rdbms/public -I/apps/oracli/DSM/9.2.0/plsql/public -I/apps/oracli/ +DSM/9.2.0/network/public -I/var/tmp/Perl/lib/site_perl/5.8.8/sun4-sol +aris-thread-multi/auto/DBI -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT - +DUSE_SITECUSTOMIZE -DNO_HASH_SEED -D_LARGEFILE_SOURCE -D_FILE_OFFSET_ +BITS=64 -O -DVERSION=\"1.18\" -DXS_VERSION=\"1.18\" -KPIC "-I/var +/tmp/Perl/lib/5.8.8/sun4-solaris-thread-multi/CORE" -DUTF8_SUPPORT - +DNEW_OCI_INIT -DORA_OCI_VERSION=\"9.2.0.1\" dbdimp.c "dbdimp.c", line 11: warning: invalid white space character in directi +ve "dbdimp.c", line 13: warning: invalid white space character in directi +ve "dbdimp.c", line 15: warning: invalid white space character in directi +ve "dbdimp.c", line 18: warning: invalid white space character in directi +ve "dbdimp.c", line 20: warning: invalid white space character in directi +ve "/apps/oracli/DSM/9.2.0/rdbms/demo/ort.h", line 927: warning: paramete +r has incomplete type: tdo "/apps/oracli/DSM/9.2.0/rdbms/demo/ort.h", line 1042: warning: paramet +er has incomplete type: type_ref "/apps/oracli/DSM/9.2.0/rdbms/demo/ort.h", line 1044: warning: paramet +er has incomplete type: tdo "/apps/oracli/DSM/9.2.0/rdbms/demo/ociap.h", line 6338: warning: param +eter has incomplete type: hndl "/apps/oracli/DSM/9.2.0/rdbms/demo/ociap.h", line 6556: warning: param +eter has incomplete type: argv "dbdimp.c", line 22: warning: invalid white space character in directi +ve "dbdimp.c", line 24: warning: invalid white space character in directi +ve "dbdimp.c", line 27: warning: invalid white space character in directi +ve "dbdimp.c", line 28: warning: invalid white space character in directi +ve "dbdimp.c", line 31: warning: invalid white space character in directi +ve "dbdimp.c", line 32: syntax error before or at: -> "dbdimp.c", line 32: undefined or not a type: sv_flags "dbdimp.c", line 32: syntax error before or at: * "dbdimp.c", line 32: undefined or not a type: h "dbdimp.c", line 32: syntax error before or at: -> "dbdimp.c", line 32: undefined or not a type: sv_any "dbdimp.c", line 32: undefined or not a type: xrv_rv "dbdimp.c", line 32: undefined or not a type: sv_flags "dbdimp.c", line 32: undefined or not a type: SVt_PVHV "dbdimp.c", line 32: invalid source character: '\' "dbdimp.c", line 33: syntax error before or at: * "dbdimp.c", line 33: undefined or not a type: h "dbdimp.c", line 33: syntax error before or at: -> "dbdimp.c", line 33: undefined or not a type: sv_any "dbdimp.c", line 33: undefined or not a type: xrv_rv "dbdimp.c", line 33: undefined or not a type: sv_flags "dbdimp.c", line 33: syntax error before or at: * "dbdimp.c", line 33: syntax error before or at: * "dbdimp.c", line 33: undefined or not a type: h "dbdimp.c", line 33: syntax error before or at: -> "dbdimp.c", line 33: undefined or not a type: sv_any "dbdimp.c", line 33: undefined or not a type: xrv_rv "dbdimp.c", line 33: undefined or not a type: sv_any "dbdimp.c", line 33: undefined or not a type: xmg_magic "dbdimp.c", line 33: undefined or not a type: mg_type "dbdimp.c", line 35: warning: invalid white space character in directi +ve "dbdimp.c", line 37: warning: invalid white space character in directi +ve "dbdimp.c", line 107: cannot recover from previous errors cc: acomp failed for dbdimp.c *** Error code 2 make: Fatal error: Command failed for target `dbdimp.o'

Replies are listed 'Best First'.
Re: dbd::oracle compile problem
by chargrill (Parson) on Jul 26, 2006 at 18:57 UTC

    Your Solaris-shipped Perl was likely compiled with forte, Sun's compiler. You've likely installed gcc to attempt to install your module. gcc can't compile against that Perl. At least not without some elbow grease.

    There are some compiler flags (CCFLAGS) you can use as a workaround, -fPIC (instead of -KPIC) - check your Makefile. Also be sure to google around for this. I used to have this kind of stuff posted on a wiki at my last job because I ran into it frequently. There are some other things you'll have to look out for, thankfully plenty of people have googlable resolutions to issues like yours - search for something like "perl solaris gcc".

    Another option is to recompile your Perl with gcc.

    Update: You can also ask your company to purchase Sun's compiler tools.

    HTH



    --chargrill
    $,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]}
      No it didn't worked for -fPIC either, it doesn't even recognise this -fPIC option at all.

        Ok, what compiler was your perl built under? (This can be found out with perl -V).

        I see "cc" as the compiler you're trying to use for dbd::oracle - what compiler is that?

        Exactly *what* is the "it" that doesn't recognize -fPIC? Where'd you put that flag?

        Did you check your Makefile? Did you google around for the problem with the hints I've given you?



        --chargrill
        $,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]}
Re: dbd::oracle compile problem
by lorn (Monk) on Jul 26, 2006 at 18:43 UTC
Re: dbd::oracle compile problem
by derby (Abbot) on Jul 26, 2006 at 18:34 UTC

    It looks like a bad configuration for your Makefile (did you perl Makefile.PL?). Double check to see if the cc your using to compile is the same version used to compile perl (perl -v).

    -derby
      Its the same version of Perl (5.8.8) I am using for everything. In fact I have already build and installed many modules using the same, Oracle is the only one which is giving trouble.

        Chances are this is the first module you've encountered that contains XS code, or code that needs to be compiled with ... well, a compiler. :)



        --chargrill
        $,=42;for(34,0,-3,9,-11,11,-17,7,-5){$*.=pack'c'=>$,+=$_}for(reverse s +plit//=>$* ){$%++?$ %%2?push@C,$_,$":push@c,$_,$":(push@C,$_,$")&&push@c,$"}$C[$# +C]=$/;($#C >$#c)?($ c=\@C)&&($ C=\@c):($ c=\@c)&&($C=\@C);$%=$|;for(@$c){print$_^ +$$C[$%++]}