Hi there,

I have been having problems compiling DBD::ODBC under RedHat 7.3.

OS: RedHat 7.3
Kernel: 2.4.20-28.7 (most recent official RH73 update)
Glibc: glibc-2.2.5-44 (most recent official RH73 update)
gcc: gcc-2.96-113 (most recent official RH73 update)
DBI: perl-DBI-1.21-1 (official RH73 pkg)
UnixODBC: unixODBC-2.2.0-5 (official RH73 pkg)
Perl: perl-5.6.1-34.99.6 (official RH73 pkg)

All of the above was installed with binary RPM packages (as you may
guess by the hyphenated version number ;). The unixODBC package dropped
the libs in /usr/lib
eg. /usr/lib/libodbc.so.1
/usr/lib/libodbc.so.1.0.0

The unixODBC-devel package drops sql.h in /usr/include/sql.h

If I set ODBCHOME to /usr/lib, running "perl Makefile.PL" fails (it
can't find the driver manager). This seems to be due to an assumption
that it will find the drivers in $ODBCHOME/lib. If I set ODBCHOME to
/usr, "perl Makefile.PL" completes but with the following warnings
(DBD::ODBC 1.09):

# perl Makefile.PL
Useless use of private variable in void context at Makefile.PL line 430.
 
Configuring DBD::ODBC ...
 
>>>     Remember to actually *READ* the README file!
        And re-read it if you have any problems.
 
Using DBI 1.21 installed in
/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/DBI
Using ODBC in /usr
Use of uninitialized value in substitution (s///) at Makefile.PL line
154.
 
Umm, this looks like a unixodbc type of driver manager.
We expect to find the sql.h, sqlext.h and (which were
supplied with unixODBC) in $ODBCHOME/include directory alongside
the /usr/lib/libodbc.a /usr/lib/libodbc.so library. in $ODBCHOME/lib
 
Warning: LD_LIBRARY_PATH doesn't include /usr
 
Injecting selected odbc driver into cc command
Using DBI 1.21 installed in
/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/DBI
Writing Makefile for DBD::ODBC
 
The DBD::ODBC tests will use these values for the database connection:
    DBI_DSN=dbi:ODBC:emu                e.g. dbi:ODBC:demo
    DBI_USER=<snip!>
    DBI_PASS=<snip!>

The warnings above didn't look too critical although having uninitalised
variables when generating the Makefile isn't exactly comforting. Let's
try the make:

DBD-ODBC-1.09]$ make
gcc -c -I/usr/include -I.
-I/usr/lib/perl5/site_perl/5.6.1/i386-linux/auto/DBI
-fno-strict-aliasing -I/usr/local/include -O2 -march=i386 -mcpu=i686  
-DVERSION=\"1.09\" -DXS_VERSION=\"1.09\" -fPIC
-I/usr/lib/perl5/5.6.1/i386-linux/CORE -I/usr/include dbdimp.c
dbdimp.c: In function `odbc_clear_result_set':
dbdimp.c:157: parse error before `static'
dbdimp.c:160: `debug' undeclared (first use in this function)
dbdimp.c:160: (Each undeclared identifier is reported only once
dbdimp.c:160: for each function it appears in.)
dbdimp.c:162: `i' undeclared (first use in this function)
dbdimp.c:162: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:169: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:202: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:212: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:224: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:229: parse error before `int'
dbdimp.c:238: invalid type argument of `->'
dbdimp.c:240: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:253: warning: `return' with a value, in function returning void
dbdimp.c:257: warning: `return' with a value, in function returning void
dbdimp.c:261: `orc' undeclared (first use in this function)
dbdimp.c:266: warning: `return' with a value, in function returning void
dbdimp.c:274: warning: `return' with a value, in function returning void
dbdimp.c:277: parse error before `int'
dbdimp.c:285: `imp_drh' undeclared (first use in this function)
dbdimp.c:288: `drh' undeclared (first use in this function)
dbdimp.c:290: warning: `return' with a value, in function returning void
dbdimp.c:292: warning: `return' with a value, in function returning void
dbdimp.c:297: parse error before `int'
dbdimp.c:305: `imp_dbh' undeclared (first use in this function)
dbdimp.c:306: `dbh' undeclared (first use in this function)
dbdimp.c:307: warning: `return' with a value, in function returning void
dbdimp.c:310: `ret' undeclared (first use in this function)
dbdimp.c:310: `stmt' undeclared (first use in this function)
dbdimp.c:313: warning: `return' with a value, in function returning void
dbdimp.c:316: invalid type argument of `->'
dbdimp.c:318: `statement' undeclared (first use in this function)
dbdimp.c:318: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:324: `rows' undeclared (first use in this function)
dbdimp.c:348: warning: `return' with a value, in function returning void
dbdimp.c: In function `odbc_db_destroy':
dbdimp.c:364: invalid type argument of `->'
dbdimp.c:365: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:366: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_db_login6':
dbdimp.c:513: invalid type argument of `->'
dbdimp.c:514: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:542: invalid type argument of `->'
dbdimp.c:546: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:577: warning: passing arg 5 of `AllODBCErrors' makes pointer
from integer without a cast
dbdimp.c:580: invalid type argument of `->'
dbdimp.c:581: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:600: invalid type argument of `->'
dbdimp.c:600: warning: passing arg 5 of `AllODBCErrors' makes pointer
from integer without a cast
dbdimp.c:662: invalid type argument of `->'
dbdimp.c:663: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:670: invalid type argument of `->'
dbdimp.c:672: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:680: invalid type argument of `->'
dbdimp.c:681: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:684: invalid type argument of `->'
dbdimp.c:684: warning: passing arg 5 of `AllODBCErrors' makes pointer
from integer without a cast
dbdimp.c:697: invalid type argument of `->'
dbdimp.c:698: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:701: invalid type argument of `->'
dbdimp.c:701: warning: passing arg 5 of `AllODBCErrors' makes pointer
from integer without a cast
dbdimp.c:708: invalid type argument of `->'
dbdimp.c:709: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:713: invalid type argument of `->'
dbdimp.c:714: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_db_disconnect':
dbdimp.c:750: invalid type argument of `->'
dbdimp.c:750: warning: passing arg 5 of `AllODBCErrors' makes pointer
from integer without a cast
dbdimp.c:755: invalid type argument of `->'
dbdimp.c:756: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `dbd_error2':
dbdimp.c:873: invalid type argument of `->'
dbdimp.c:875: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:898: invalid type argument of `->'
dbdimp.c:899: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:944: invalid type argument of `->'
dbdimp.c:947: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:950: invalid type argument of `->'
dbdimp.c:952: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:981: invalid type argument of `->'
dbdimp.c:983: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_error':
dbdimp.c:1023: invalid type argument of `->'
dbdimp.c: In function `dbd_caution':
dbdimp.c:1053: invalid type argument of `->'
dbdimp.c:1055: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `dbd_preparse':
dbdimp.c:1097: invalid type argument of `->'
dbdimp.c:1099: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1148: invalid type argument of `->'
dbdimp.c:1150: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1181: invalid type argument of `->'
dbdimp.c:1183: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_st_tables':
dbdimp.c:1237: invalid type argument of `->'
dbdimp.c:1239: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_st_primary_keys':
dbdimp.c:1297: invalid type argument of `->'
dbdimp.c:1299: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_st_prepare':
dbdimp.c:1370: invalid type argument of `->'
dbdimp.c:1372: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1382: invalid type argument of `->'
dbdimp.c:1384: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_describe':
dbdimp.c:1523: invalid type argument of `->'
dbdimp.c:1525: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1526: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c:1544: invalid type argument of `->'
dbdimp.c:1545: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1546: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c:1549: invalid type argument of `->'
dbdimp.c:1549: warning: passing arg 5 of `AllODBCErrors' makes pointer
from integer without a cast
dbdimp.c:1555: invalid type argument of `->'
dbdimp.c:1556: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1557: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c:1567: invalid type argument of `->'
dbdimp.c:1569: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1572: invalid type argument of `->'
dbdimp.c:1575: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1605: invalid type argument of `->'
dbdimp.c:1607: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1608: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c:1685: invalid type argument of `->'
dbdimp.c:1691: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1700: invalid type argument of `->'
dbdimp.c:1701: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1702: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c:1738: invalid type argument of `->'
dbdimp.c:1741: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1757: invalid type argument of `->'
dbdimp.c:1760: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1762: invalid type argument of `->'
dbdimp.c:1764: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1765: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c:1772: invalid type argument of `->'
dbdimp.c:1775: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1786: invalid type argument of `->'
dbdimp.c:1789: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1791: invalid type argument of `->'
dbdimp.c:1799: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1805: invalid type argument of `->'
dbdimp.c:1808: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_st_execute':
dbdimp.c:1829: invalid type argument of `->'
dbdimp.c:1847: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1868: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1902: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1903: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c:1915: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1916: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c:1942: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:1943: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c:1978: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2013: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2020: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2021: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c:2041: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_st_fetch':
dbdimp.c:2086: invalid type argument of `->'
dbdimp.c:2105: invalid type argument of `->'
dbdimp.c:2106: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2113: invalid type argument of `->'
dbdimp.c:2114: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2120: invalid type argument of `->'
dbdimp.c:2121: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2132: invalid type argument of `->'
dbdimp.c:2132: warning: passing arg 5 of `AllODBCErrors' makes pointer
from integer without a cast
dbdimp.c:2148: invalid type argument of `->'
dbdimp.c:2149: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2188: invalid type argument of `->'
dbdimp.c:2191: invalid type argument of `->'
dbdimp.c:2192: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2200: invalid type argument of `->'
dbdimp.c:2202: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_st_finish':
dbdimp.c:2291: invalid type argument of `->'
dbdimp.c:2292: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_st_destroy':
dbdimp.c:2344: invalid type argument of `->'
dbdimp.c:2345: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2346: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c: In function `_dbd_get_param_type':
dbdimp.c:2381: invalid type argument of `->'
dbdimp.c:2382: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2392: invalid type argument of `->'
dbdimp.c:2393: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2395: invalid type argument of `->'
dbdimp.c:2395: warning: passing arg 5 of `AllODBCErrors' makes pointer
from integer without a cast
dbdimp.c:2399: invalid type argument of `->'
dbdimp.c:2402: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2414: invalid type argument of `->'
dbdimp.c:2417: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `_dbd_rebind_ph':
dbdimp.c:2452: invalid type argument of `->'
dbdimp.c:2457: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2458: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c:2495: invalid type argument of `->'
dbdimp.c:2498: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2499: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c:2640: invalid type argument of `->'
dbdimp.c:2644: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2663: invalid type argument of `->'
dbdimp.c:2667: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2669: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_bind_ph':
dbdimp.c:2740: invalid type argument of `->'
dbdimp.c:2742: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2743: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_st_blob_read':
dbdimp.c:2844: invalid type argument of `->'
dbdimp.c:2847: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:2871: invalid type argument of `->'
dbdimp.c:2873: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_db_STORE_attrib':
dbdimp.c:2950: invalid type argument of `->'
dbdimp.c:2952: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:3048: invalid type argument of `->'
dbdimp.c:3050: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:3067: invalid type argument of `->'
dbdimp.c:3069: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:3076: invalid type argument of `->'
dbdimp.c:3078: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_db_FETCH_attrib':
dbdimp.c:3188: invalid type argument of `->'
dbdimp.c:3189: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:3272: invalid type argument of `->'
dbdimp.c:3274: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_st_FETCH_attrib':
dbdimp.c:3380: invalid type argument of `->'
dbdimp.c:3381: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:3398: invalid type argument of `->'
dbdimp.c:3399: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:3406: invalid type argument of `->'
dbdimp.c:3408: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:3411: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:3412: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c:3414: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c:3417: invalid type argument of `->'
dbdimp.c:3419: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:3420: warning: passing arg 1 of `fflush' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_get_info':
dbdimp.c:3604: invalid type argument of `->'
dbdimp.c:3606: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_get_primary_keys':
dbdimp.c:3687: invalid type argument of `->'
dbdimp.c:3688: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_col_attributes':
dbdimp.c:3947: invalid type argument of `->'
dbdimp.c:3951: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:3952: invalid type argument of `->'
dbdimp.c:3957: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c:3958: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
dbdimp.c: In function `odbc_db_columns':
dbdimp.c:4032: invalid type argument of `->'
dbdimp.c:4034: warning: passing arg 1 of `fprintf' makes pointer from
integer without a cast
make: *** [dbdimp.o] Error 1

Both "make" and "make test" output the above.

I was a bit dubious about the library locations but the errors above
don't seem to be related to that but rather the use of the "->"
operator. Maybe that's a side-effect of something else though... I'm
hoping I don't have to upgrade gcc on this box just for DBD::ODBC but if
that's what people think it will take I'll do it.

I tried DBD:::ODBC 1.00 and 1.02. They both fail with almost identical
output to 1.09. DBD::ODBC 0.43 seems to work OK. It compiles and runs.
("perl Makefile.PL" fails a couple of /t tests possibly wrt date
functionality but claims that these are probably OK)

Also of note is that I haven't upgraded perl to the latest Red Hat 7.3
errata version. This is because we have a lot of production
programs/websites that are heavily reliant on perl and I'd prefer not to
risk breaking them. If anyone suspects the perl version though I'll
update perl this weekend and deal with the breakage.

If I can supply any more information to assist hunting this down please
let me know. Otherwise if I get time I'll try to fix it and give you a
progress update.

Any assistance will be greatly appreciated. Thanks.

Cheers
-- 
Andrew McDonald                         [EMAIL PROTECTED]
System Engineering                      W: +61 3 9915-1105
Spider Eye Studios                      M: 0407-612-790
got standards? http://www.w3.org/       http://www.spidereye.com

Reply via email to