Обсуждение: postodbc on sparc2.5.1
I have been trying to implement postodbc on a solaris sparc 2.5.1. (source distribution from insightdist.com v0249). I have got it to compile but not load yet. made the following changes to config.h #define WINAPI typedef void* HINSTANCE; #define INADDR_NONE -1 changed all <config.h> to "config.h". The following functions weren't found by the loader: LoadLibrary FreeLibrary GetProcAddress parse_command Noticed that parse_command was implemented in parse.c which was left out of the object list. Added this and parse_command was found by the linker but SQLColumns now not found. Note: all functions not found by the linker are Window's APIs. Tried linking in the libiodbc.a file. The linker found the missing functions but now SQLError is a multiple define. Should I remove the implementation for SQLError in postodbc to eliminate the final linker error. Is this the right way to go, or is there some other solution? John Sharp
> I have been trying to implement postodbc on a solaris sparc 2.5.1. > (source distribution from insightdist.com v0249). psqlodbc? > I have got it to compile but not load yet. > SQLColumns now not found. Note: all functions not found by > the linker are Window's APIs. SQLColumns is in info.c, which should be in the distribution. > Tried linking in the libiodbc.a file. The linker found the missing > functions but now SQLError is a multiple define. > Should I remove the implementation for SQLError in postodbc to > eliminate the final linker error. Is this the right way to go, or is > there some other solution? Wrong way to go. iODBC should _not_ be linked directly with your psqlodbc image, because it has duplicate routines for every ODBC API! It relies on explicit dynamic loading to find the psqlodbc routines at runtime. You will need to find the linker options which force your psqlodbc library to resolve all symbols internally. That way it won't be linked back to iODBC at runtime (which happened to me on Linux). Don't know what the options would be for Solaris; on Linux it is -Bsymbolic. I had to include libc and libm in the link step to resolve the printf and pow functions used by psqlodbc. You will also need a decent ~/.odbc.ini file. Let me know if you don't already have one... - Tom
> ... maybe you should include your .odbc.ini > file with the distribution as an example. Obviously it wouldn't work > for other people but at least they > might have a better idea of what to put in it. I've written some sgml docs which include these files as examples. The examples are necessary. The combination of section labels required by iodbc and psqlodbc for the odbcinst.ini and odbc.ini files is not particularly obvious or consistant. In particular, psqlodbc requires a section label 'PostgreSQL' in the odbcinst.ini file while iodbc requires a label of 'Default' for driver info in .odbc.ini afaik. Unix-specific examples will be in the v6.4 documentation set. Byron and InsightDist are doing such a good job of supporting the Windows clients with code and docs that I'm not sure how or if those docs should be merged with the Postgres doc set. Byron? > Are you going to release your changes soon? I'm waiting to hear back from Byron on how he want to re-merge. If he isn't available soon I'll probably just check things in to the postgresql.org cvs repository, which is what he might have wanted me to do anyway. - Tom
Thomas G. Lockhart wrote: > > Are you going to release your changes soon? > > I'm waiting to hear back from Byron on how he want to re-merge. If he > isn't available soon I'll probably just check things in to the > postgresql.org cvs repository, which is what he might have wanted me to > do anyway. > Ummm, sorry I didn't know you were waiting to hear from me. Just send me the stuff and I'll update the repository once I build and test it under Windows. Byron
Thomas G. Lockhart wrote: > > > ... maybe you should include your .odbc.ini > > file with the distribution as an example. Obviously it wouldn't work > > for other people but at least they > > might have a better idea of what to put in it. > > I've written some sgml docs which include these files as examples. The > examples are necessary. The combination of section labels required by > iodbc and psqlodbc for the odbcinst.ini and odbc.ini files is not > particularly obvious or consistant. In particular, psqlodbc requires a > section label 'PostgreSQL' in the odbcinst.ini file while iodbc requires > a label of 'Default' for driver info in .odbc.ini afaik. iodbc doesn't NEED the 'Default' label but if no other DSN entry is given when SQLDriverConnect is called than iodbc uses the 'Default' entry. At least this is what should happen if the last parameter to SQLDriverConnect is set to SQL_DRIVER_NOPROMPT. If the last parameter is anything else and the DSN ISN'T specificied, iodbc SHOULD bring up a dialog box which presumably would allow the user to select a DSN source from their .odbc.ini file. Unfortunately the function that is supposed to do this called '_iodbcdm_drvconn_dialbox' is not in iodbc-2.12 and thus the SQLDriverConnect call should fail in this case, at least that's my reading of the code(see SQLDriverConnect in file connect.c of iodbc). Any volunteers for writing this function? I was going to doing something with this since psqlodbc needs(wants) something similar to allow the user to change the settings for a specific DSN when its SQLDriverConnect is called, I just never got around to it. -- Gerald Gryschuk(ggryschuk@scf.sk.ca) Programmer Analyst Saskatoon Cancer Centre ((306)655-2746)