Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[psqlodbc-REL-16_00_0004][Postgres 15 5][Debian][unixODBC] Need to add CPPFLAGS="-DSQLCOLATTRIBUTE_SQLLEN" to configure to get it to compile #16

Open
jboakye opened this issue May 13, 2024 · 5 comments

Comments

@jboakye
Copy link

jboakye commented May 13, 2024

Otherwise we get the error below. Same issue with previous releases.

odbcapi30.c:120:1: error: conflicting types for 'SQLColAttribute'; have 'SQLRETURN(void *, SQLUSMALLINT, SQLUSMALLINT, void *, SQLSMALLINT, SQLSMALLINT *, void *)' {aka 'short int(void *, short unsigned int, short unsigned int, void *, short int, short int *, void *)'}
120 | SQLColAttribute(SQLHSTMT StatementHandle,
| ^~~~~~~~~~~~~~~
In file included from psqlodbc.h:145,
from odbcapi30.c:21:
/usr/local/include/sql.h:613:24: note: previous declaration of 'SQLColAttribute' with type 'SQLRETURN(void *, SQLUSMALLINT, SQLUSMALLINT, void *, SQLSMALLINT, SQLSMALLINT *, SQLLEN *)' {aka 'short int(void *, short unsigned int, short unsigned int, void *, short int, short int *, long int *)'}
613 | SQLRETURN SQL_API SQLColAttribute(SQLHSTMT StatementHandle,
| ^~~~~~~~~~~~~~~

@jboakye jboakye changed the title [psqlodbc-REL-16_00_0004][Postgres 15 5] Need to add CPPFLAGS="-DSQLCOLATTRIBUTE_SQLLEN" to configure to get it to compile [psqlodbc-REL-16_00_0004][Postgres 15 5][Debian] Need to add CPPFLAGS="-DSQLCOLATTRIBUTE_SQLLEN" to configure to get it to compile May 13, 2024
@jboakye jboakye changed the title [psqlodbc-REL-16_00_0004][Postgres 15 5][Debian] Need to add CPPFLAGS="-DSQLCOLATTRIBUTE_SQLLEN" to configure to get it to compile [psqlodbc-REL-16_00_0004][Postgres 15 5][Debian][unixODBC] Need to add CPPFLAGS="-DSQLCOLATTRIBUTE_SQLLEN" to configure to get it to compile May 13, 2024
@davecramer
Copy link
Contributor

@jboakye when did it stop compiling ?

@jboakye
Copy link
Author

jboakye commented May 13, 2024

@davecramer I only downloaded it a few days ago and found the issue with it. This is my first time having to compile it on debian and standalone from the postgres source tree (I think) and in general I have not had to deal with this driver for over 4 years or so as I was too busy to work on this project that requires it.

@jboakye
Copy link
Author

jboakye commented May 13, 2024

I tried the 8xx release also in the last few days and found the same issue.

@jboakye
Copy link
Author

jboakye commented May 13, 2024

This is the actual compiler invocation if that helps:
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I -I/d/postgres/postgresql_15_5/src/bin/include -I/d/postgres/postgresql_15_5/src/bin/include/postgresql/internal -I/usr/local/pgsql/include -I/usr/local/pgsql/include/internal -DUNICODE_SUPPORT -g -O2 -Wall -MT psqlodbcw_la-odbcapi30.lo -MD -MP -MF .deps/psqlodbcw_la-odbcapi30.Tpo -c odbcapi30.c -fPIC -DPIC -o .libs/psqlodbcw_la-odbcapi30.o

@jboakye
Copy link
Author

jboakye commented May 13, 2024

I did bootstrap and then configure prior:
./configure --with-unixodbc=/usr/local/bin --with-libpq=/d/postgres/postgresql_15_5/src/bin

Everything works fine with this configure line (and after replacing _strdup with strdup in psqlodbc.h):
./configure CPPFLAGS="-DSQLCOLATTRIBUTE_SQLLEN" --with-unixodbc=/usr/local/bin --with-libpq=/d/postgres/postgresql_15_5/src/bin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants