X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 27D848B9F61 for ; Tue, 8 Feb 2005 16:46:15 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 30195-03 for ; Tue, 8 Feb 2005 16:46:05 +0000 (GMT) Received: from mx2.magma.ca (mx2.magma.ca [206.191.0.250]) by svr1.postgresql.org (Postfix) with ESMTP id 3D5978B9F31 for ; Tue, 8 Feb 2005 16:46:04 +0000 (GMT) Received: from mail4.magma.ca (mail4.magma.ca [206.191.0.222]) by mx2.magma.ca (8.13.0/8.13.0) with ESMTP id j18Gjvwa031812 for ; Tue, 8 Feb 2005 11:45:58 -0500 Received: from smtp_relay.engineering.n-able.com ([209.217.70.195]) by mail4.magma.ca (8.13.0/8.13.0) with ESMTP id j18Gjv8G023414 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 8 Feb 2005 11:45:58 -0500 Received: from mail.engineering.n-able.com (dns.engineering.n-able.com [192.168.20.3]) by smtp_relay.engineering.n-able.com (8.12.11/8.12.11) with ESMTP id j18GiLBt010308 for ; Tue, 8 Feb 2005 11:44:21 -0500 Received: from host-155.engineering.n-able.com (host-155.engineering.n-able.com [192.168.20.155]) by mail.engineering.n-able.com (8.12.8/8.12.8) with ESMTP id j18GjtuS030781 for ; Tue, 8 Feb 2005 11:45:55 -0500 Subject: v07.03.0200: Make errors if configured --with-odbcver=0x0100 From: Justin Cranford To: pgsql-odbc@postgresql.org Content-Type: multipart/alternative; boundary="=-5kikQFaMK1Y3x7Zo7jrp" Message-Id: <1107881228.3667.42.camel@host-155.engineering.n-able.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 08 Feb 2005 11:47:08 -0500 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.296 tagged_above=0 required=5 tests=HTML_10_20, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200502/36 X-Sequence-Number: 4926 --=-5kikQFaMK1Y3x7Zo7jrp Content-Type: text/plain Content-Transfer-Encoding: 7bit I want to use unixODBC with default ODBC version = 1.0 on Redhat 9. Configure produces code that does not compile when I specify this combination. Make fails to compile info.c when I specify --with-odbcver=0x0100 plus one or both of unixODBC or iODBC. These combinations of configure parameters produce code that does not compile: configure -q --prefix=/sandbox/psqlodbc --enable-pthreads --with-odbcver=0x0100 --with-unixodbc --with-iodbc configure -q --prefix=/sandbox/psqlodbc --enable-pthreads --with-odbcver=0x0100 --with-unixodbc --without-iodbc configure -q --prefix=/sandbox/psqlodbc --enable-pthreads --with-odbcver=0x0100 --without-unixodbc --with-iodbc The only way to avoid the compile errors is to exclude both unixODBC and iODBC when specifying --with-odbcver=0x0100, or leave out the --with-odbcver parameter. These combinations of configure parameters produce code that compiles ok on Redhat 9: configure -q --prefix=/sandbox/psqlodbc --enable-pthreads --without-unixodbc --with-iodbc configure -q --prefix=/sandbox/psqlodbc --enable-pthreads --with-unixodbc --without-iodbc configure -q --prefix=/sandbox/psqlodbc --enable-pthreads --without-unixodbc --without-iodbc --with-odbcver=0x0100 The problem seems to be with compiler preprocessor directives because info.c fails to include these missing definitions from isqlext.h. gcc -DHAVE_CONFIG_H -I. -I/tmp/psqlodbc-07.03.0200 -MT info.lo -MD -MP -MF .deps/info.Tpo -c /tmp/psqlodbc-07.03.0200/info.c -fPIC -DPIC -o info.lo /tmp/psqlodbc-07.03.0200/info.c: In function `PGAPI_GetInfo': /tmp/psqlodbc-07.03.0200/info.c:103: `SQL_AT_ADD_COLUMN' undeclared (first use in this function) /tmp/psqlodbc-07.03.0200/info.c:103: (Each undeclared identifier is reported only once /tmp/psqlodbc-07.03.0200/info.c:103: for each function it appears in.) /tmp/psqlodbc-07.03.0200/info.c:105: `SQL_AT_DROP_COLUMN' undeclared (first use in this function) /tmp/psqlodbc-07.03.0200/info.c:499: `SQL_OJ_CAPABILITIES' undeclared (first use in this function) /tmp/psqlodbc-07.03.0200/info.c:504: `SQL_OJ_LEFT' undeclared (first use in this function) /tmp/psqlodbc-07.03.0200/info.c:505: `SQL_OJ_RIGHT' undeclared (first use in this function) /tmp/psqlodbc-07.03.0200/info.c:506: `SQL_OJ_FULL' undeclared (first use in this function) /tmp/psqlodbc-07.03.0200/info.c:507: `SQL_OJ_NESTED' undeclared (first use in this function) /tmp/psqlodbc-07.03.0200/info.c:508: `SQL_OJ_NOT_ORDERED' undeclared (first use in this function) /tmp/psqlodbc-07.03.0200/info.c:509: `SQL_OJ_INNER' undeclared (first use in this function) /tmp/psqlodbc-07.03.0200/info.c:510: `SQL_OJ_ALL_COMPARISON_OPS' undeclared (first use in this function) /tmp/psqlodbc-07.03.0200/info.c: In function `PGAPI_ForeignKeys': /tmp/psqlodbc-07.03.0200/info.c:3849: `SQL_NO_ACTION' undeclared (first use in this function) /tmp/psqlodbc-07.03.0200/info.c:3853: `SQL_SET_DEFAULT' undeclared (first use in this function) make[1]: *** [info.lo] Error 1 The file psqlodbc.h included by info.c contains the following lines... #if defined(WIN32) || defined(WITH_UNIXODBC) || defined(WITH_IODBC) #include #include #else #include "iodbc.h" #include "isql.h" #include "isqlext.h" #endif The missing definitions are in isqlext.h with is excluded if unixODBC or iODBC are used with ODBCVER=1.0. However, if ODBCVER is not overridden the definitions are included ok. This implies the problem lies in sql.h or sqlext.h which probably include isqlext.h indirectly. --=-5kikQFaMK1Y3x7Zo7jrp Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit I want to use unixODBC with default ODBC version = 1.0 on Redhat 9. Configure produces code that does not compile when I specify this combination.

Make fails to compile info.c when I specify --with-odbcver=0x0100 plus one or both of unixODBC or iODBC. These combinations of configure parameters produce code that does not compile:

configure -q --prefix=/sandbox/psqlodbc --enable-pthreads --with-odbcver=0x0100 --with-unixodbc --with-iodbc
configure -q --prefix=/sandbox/psqlodbc --enable-pthreads --with-odbcver=0x0100 --with-unixodbc --without-iodbc
configure -q --prefix=/sandbox/psqlodbc --enable-pthreads --with-odbcver=0x0100 --without-unixodbc --with-iodbc

The only way to avoid the compile errors is to exclude both unixODBC and iODBC when specifying --with-odbcver=0x0100, or leave out the --with-odbcver parameter. These combinations of configure parameters produce code that compiles ok on Redhat 9:

configure -q --prefix=/sandbox/psqlodbc --enable-pthreads --without-unixodbc --with-iodbc
configure -q --prefix=/sandbox/psqlodbc --enable-pthreads --with-unixodbc --without-iodbc
configure -q --prefix=/sandbox/psqlodbc --enable-pthreads --without-unixodbc --without-iodbc --with-odbcver=0x0100



The problem seems to be with compiler preprocessor directives because info.c fails to include these missing definitions from isqlext.h.

gcc -DHAVE_CONFIG_H -I. -I/tmp/psqlodbc-07.03.0200 -MT info.lo -MD -MP -MF .deps/info.Tpo -c /tmp/psqlodbc-07.03.0200/info.c  -fPIC -DPIC -o info.lo
/tmp/psqlodbc-07.03.0200/info.c: In function `PGAPI_GetInfo':
/tmp/psqlodbc-07.03.0200/info.c:103: `SQL_AT_ADD_COLUMN' undeclared (first use in this function)
/tmp/psqlodbc-07.03.0200/info.c:103: (Each undeclared identifier is reported only once
/tmp/psqlodbc-07.03.0200/info.c:103: for each function it appears in.)
/tmp/psqlodbc-07.03.0200/info.c:105: `SQL_AT_DROP_COLUMN' undeclared (first use in this function)
/tmp/psqlodbc-07.03.0200/info.c:499: `SQL_OJ_CAPABILITIES' undeclared (first use in this function)
/tmp/psqlodbc-07.03.0200/info.c:504: `SQL_OJ_LEFT' undeclared (first use in this function)
/tmp/psqlodbc-07.03.0200/info.c:505: `SQL_OJ_RIGHT' undeclared (first use in this function)
/tmp/psqlodbc-07.03.0200/info.c:506: `SQL_OJ_FULL' undeclared (first use in this function)
/tmp/psqlodbc-07.03.0200/info.c:507: `SQL_OJ_NESTED' undeclared (first use in this function)
/tmp/psqlodbc-07.03.0200/info.c:508: `SQL_OJ_NOT_ORDERED' undeclared (first use in this function)
/tmp/psqlodbc-07.03.0200/info.c:509: `SQL_OJ_INNER' undeclared (first use in this function)
/tmp/psqlodbc-07.03.0200/info.c:510: `SQL_OJ_ALL_COMPARISON_OPS' undeclared (first use in this function)
/tmp/psqlodbc-07.03.0200/info.c: In function `PGAPI_ForeignKeys':
/tmp/psqlodbc-07.03.0200/info.c:3849: `SQL_NO_ACTION' undeclared (first use in this function)
/tmp/psqlodbc-07.03.0200/info.c:3853: `SQL_SET_DEFAULT' undeclared (first use in this function)
make[1]: *** [info.lo] Error 1


The file psqlodbc.h included by info.c contains the following lines...

#if defined(WIN32) || defined(WITH_UNIXODBC) || defined(WITH_IODBC)
#include <sql.h>
#include <sqlext.h>
#else
#include "iodbc.h"
#include "isql.h"
#include "isqlext.h"
#endif

The missing definitions are in isqlext.h with is excluded if unixODBC or iODBC are used with ODBCVER=1.0. However, if ODBCVER is not overridden the definitions are included ok. This implies the problem lies in sql.h or sqlext.h which probably include isqlext.h indirectly. --=-5kikQFaMK1Y3x7Zo7jrp--