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

Hi monks,
I am struggling with a problem in the installation of DBI::DB2 module. I have installed the db2 client successfully. And i also created the instances (db2inst1) for that. I am also able to connect to the db2 via command line.

   My problem is, when i am installing the DBI::DB2 module, i am unable to install the module. I also set the environment variables

  • by running the /home/db2inst1/sqllib/db2profile,
  • by exporting "export DB2_HOME=/home/db2inst1/sqllib").


       Here with, i have attaced the error message given by the "make" command.

    In file included from DB2.xs:7: DB2.h:16:67: DBIXS.h: No such file or directory In file included from DB2.h:20, from DB2.xs:7: dbdimp.h:15: error: syntax error before "dbih_drc_t" dbdimp.h:15: warning: no semicolon at end of struct or union dbdimp.h:18: error: syntax error before '*' token dbdimp.h:18: warning: data definition has no type or storage class dbdimp.h:19: error: syntax error before '}' token dbdimp.h:23: error: syntax error before "dbih_dbc_t" dbdimp.h:23: warning: no semicolon at end of struct or union dbdimp.h:27: error: syntax error before '}' token dbdimp.h:32: error: syntax error before "dbih_stc_t" dbdimp.h:32: warning: no semicolon at end of struct or union dbdimp.h:39: error: syntax error before '*' token dbdimp.h:39: warning: data definition has no type or storage class dbdimp.h:55: error: syntax error before '}' token dbdimp.h:60: error: syntax error before "imp_sth_t" dbdimp.h:60: warning: no semicolon at end of struct or union dbdimp.h:77: error: syntax error before '}' token dbdimp.h:83: error: syntax error before "SV" dbdimp.h:83: warning: no semicolon at end of struct or union dbdimp.h:85: error: conflicting types for 'bufferSize' dbdimp.h:75: error: previous declaration of 'bufferSize' was here dbdimp.h:87: error: conflicting types for 'indp' dbdimp.h:73: error: previous declaration of 'indp' was here dbdimp.h:93: error: syntax error before '}' token DB2.h:22:67: dbd_xsh.h: No such file or directory In file included from DB2.xs:7: DB2.h:24: error: syntax error before '*' token DB2.h:26: error: syntax error before "_" DB2.h:27: error: syntax error before "_" DB2.h:28: error: syntax error before "_" DB2.h:30: error: syntax error before "_" DB2.h:32: error: syntax error before "_" DB2.h:38: error: syntax error before "_" DB2.h:47: error: syntax error before "_" DB2.h:54: error: syntax error before "_" DB2.xs:13: warning: data definition has no type or storage class DB2.c:26: warning: parameter names (without types) in function declara +tion DB2.c:26: warning: data definition has no type or storage class DB2.c: In function `XS': DB2.c:29: error: `dXSARGS' undeclared (first use in this function) DB2.c:932: error: `XS_VERSION_BOOTCHECK' undeclared (first use in this + function) DB2.c:935: error: `CV' undeclared (first use in this function) DB2.c:935: error: `cv' undeclared (first use in this function) DB2.c:937: error: `XS_DBD__DB2__dr_disconnect_all' undeclared (first u +se in this function) DB2.c:939: error: `XS_DBD__DB2__dr__data_sources' undeclared (first us +e in this function) DB2.c:941: error: `XS_DBD__DB2__db__login' undeclared (first use in th +is function) DB2.c:942: error: `XS_DBD__DB2__db_commit' undeclared (first use in th +is function) DB2.c:943: error: `XS_DBD__DB2__db_rollback' undeclared (first use in +this function) DB2.c:944: error: `XS_DBD__DB2__db_disconnect' undeclared (first use i +n this function) DB2.c:945: error: `XS_DBD__DB2__db_STORE' undeclared (first use in thi +s function) DB2.c:946: error: `XS_DBD__DB2__db_FETCH' undeclared (first use in thi +s function) DB2.c:947: error: `XS_DBD__DB2__db_DESTROY' undeclared (first use in t +his function) DB2.c:948: error: `XS_DBD__DB2__db__do' undeclared (first use in this +function) DB2.c:949: error: `XS_DBD__DB2__db__ping' undeclared (first use in thi +s function) DB2.c:950: error: `XS_DBD__DB2__db__get_info' undeclared (first use in + this function) DB2.c:951: error: `XS_DBD__DB2__st__prepare' undeclared (first use in +this function) DB2.c:952: error: `XS_DBD__DB2__st_rows' undeclared (first use in this + function) DB2.c:953: error: `XS_DBD__DB2__st_bind_param' undeclared (first use i +n this function) DB2.c:954: error: `XS_DBD__DB2__st_bind_param_inout' undeclared (first + use in this function) DB2.c:955: error: `XS_DBD__DB2__st_execute' undeclared (first use in t +his function) DB2.c:956: error: `XS_DBD__DB2__st_fetchrow_arrayref' undeclared (firs +t use in this function) DB2.c:957: error: `XSANY' undeclared (first use in this function) DB2.c:960: error: `XS_DBD__DB2__st_fetchrow_array' undeclared (first u +se in this function) DB2.c:964: error: `XS_DBD__DB2__st_finish' undeclared (first use in th +is function) DB2.c:965: error: `XS_DBD__DB2__st_blob_read' undeclared (first use in + this function) DB2.c:966: error: `XS_DBD__DB2__st_STORE' undeclared (first use in thi +s function) DB2.c:967: error: `XS_DBD__DB2__st_FETCH' undeclared (first use in thi +s function) DB2.c:968: error: `XS_DBD__DB2__st_DESTROY' undeclared (first use in t +his function) DB2.c:969: error: `XS_DBD__DB2__st__table_info' undeclared (first use +in this function) DB2.c:970: error: `XS_DBD__DB2__st__primary_key_info' undeclared (firs +t use in this function) DB2.c:971: error: `XS_DBD__DB2__st__foreign_key_info' undeclared (firs +t use in this function) DB2.c:972: error: `XS_DBD__DB2__st__column_info' undeclared (first use + in this function) DB2.c:973: error: `XS_DBD__DB2__st__type_info_all' undeclared (first u +se in this function) DB2.xs:21: error: `items' undeclared (first use in this function) DB2.xs:22: error: `DBISTATE_INIT' undeclared (first use in this functi +on) DB2.xs:24: error: `imp_drh_t' undeclared (first use in this function) DB2.xs:25: error: `imp_dbh_t' undeclared (first use in this function) DB2.xs:26: error: `imp_sth_t' undeclared (first use in this function) DB2.xs:27: error: `DBIS' undeclared (first use in this function) DB2.c:993: error: `XSRETURN_YES' undeclared (first use in this functio +n) {standard input}: Assembler messages: {standard input}:40: Warning: size of "indp" is already 2; not changin +g to 4 make: *** [DB2.o] Error 1
    Can any one faced this problem ?... Please guide me to solve this problem. Realy i am struggling the entire day with this culprit.. :(
    Thanks in advance.....

    Regards,
    S.Venni Rajan.
    "A Flair For Excellence."
                    -- BK Systems.
  • Replies are listed 'Best First'.
    Re: DBI::DB2 module installation failed
    by syphilis (Archbishop) on Feb 16, 2006 at 12:26 UTC
      It's possible that it all comes down to that second line:

      DB2.h:16:67: DBIXS.h: No such file or directory

      Where is DBIXS.h ? If the system can find that file then all your problems may well vanish. In any case, the first thing to do is to fix that issue.

      Cheeers,
      Rob
        Agreed, the DBIXS.h missing line is the key portent of doom. You are correct that correct installation of DB2 Client Instance is a key prerequisite; DBI is the other. Did you already install DBI? from source kit? Is DBI source's Include dir on your INCLUDE path? Did DBI pass it's "make test"? What platform and compiler?

        You have to use the same compiler Perl itself was built with to build DBI and DBD::* -- they're C-source extensions. Remember that since the DBI and DBD::whatever are extension modules, they need to be built with the exact same C compiler & settings & library as your Perl was built. (For DBD modules the precise match is more critical than for many source modules.) This often requires building all of Perl to be sure, and using the Perl you built to make-make the DBI and DBD. Sometimes dumping the config settings can sometimes be sufficient, but general advice from Tim Bunce's website on DBI is to build your own perl from sources before building DBI from sources before building your DBD::whichever from sources.

        -- Bill_N1VUX
        as Anonymous Monk because work browser won't hold cookies, or the firewall is messing with me again.

        Resources

    Re: DBI::DB2 module installation failed
    by Tanktalus (Canon) on Feb 16, 2006 at 21:26 UTC

      Note that there are two requirements. One anonymous monk pointed out - you must have DBI installed first. The second is that you actually must have the application development client installed. The administration and runtime clients will not suffice because they're missing all the header files that are needed for compilation. (Technically, you can install the application development client, compile, and then uninstall the client and reinstall your admin or runtime client, and it should work - I've not tried that.)

      If you have anything other than the above three clients, the application development tools should be selectable for installation - you don't need to go get the application development client if you already have something else, you just have to install the tools.

      Hope that helps,

      (PS - it's DBD::DB2, not DBI::DB2. But I doubt that's your problem here.)

        Dear Tanktalus,

        Let me say thanks first. You are correct ! The module i am trying to install is "DBD-DB2-0.78".
        I have already installed the DBI module and also the driver for the DB2 "078_ADCL_LNX_32_NLV". I can able to access the DB2 thru the command line (using the command "db2"). That works fine. But, i am facing problem in installing this perl module.

           I have also set the environment variables required for the installation (this i did by executing the /home/db2inst1/sqllib/db2profile and exporting the ENV variable DB2_HOME with the value "/home/db2inst1/sqllib"). Still i am facing the problem in installation.


        I have explained all the steps i have taken here. Can u able to point out where could be problem ?
        I am struggling with this issue for the past 12 hrs :(

        Can any one help....



        Regards,
        S.Venni Rajan.
        "A Flair For Excellence."
                        -- BK Systems.

          install the missing files

          The file DBIXS.h was included in my distribution. I manually updated the Makefile to include its directory and it compiled and installed without further difficulty. -- Steve Cawley
    Re: DBI::DB2 module installation failed
    by vennirajan (Friar) on Feb 17, 2006 at 05:28 UTC
      Update:
      The module i am trying to install is "DBD::DB2" not "DBI::DB2".
      Sorry for the typo error..

      Regards,
      S.Venni Rajan.
      "A Flair For Excellence."
                      -- BK Systems.
    Re: DBI::DB2 module installation failed
    by xorl (Deacon) on Feb 17, 2006 at 13:33 UTC
      Did you install DBI via CPAN or RPM (or other package management thing)? RPMs tend to have a related devel package which has all sorts of useful things. As others have pointed out, you are missing some important files. You might also try looking for the db2-devel RPM and installing that. I'm not sure exactly what should provide the DBIXS.h file, but you need to find that before you can proceed.
        if you alraedy got those libraries in the right place, try to do this: export LD_LIBRARY_PATH=<db2_lib_path> that worked for me