[freetds] FreeTDS with Wine Issue

James K. Lowden jklowden at freetds.org
Sat May 17 11:30:12 EDT 2008

Chad Sikorra wrote:
> Suggestions:
> >
> > 1.  Upgrade.

> Suggestion number one did the trick!


> I had to do ' ./configure
> --with-unixodbc=/usr ' to get it to build correctly. It was a pain, but
> a nice learning experience I guess :)

That might be because of the odbc_config you found.  Here's confgure.ac:


	That searches your PATH for odbc_config.  

If it's not found, configure searches your systems's header files --
locations defined how?  Probably by letting the compiler do the checking
-- for isql.h or sql.h.  We're using AC_HEADER_CHECKS in autoconf.  

Whether or not it finds it, the location can be overridden later by one of
the --with options: 

AS_HELP_STRING([--with-unixodbc=DIR], [build odbc driver against unixODBC
in DIR]))
if test "$with_unixodbc"; then
	if echo "$with_unixodbc" | grep -v '^/'; then
	if test -f "$with_unixodbc/bin/odbc_config"; then
		ODBC_INC=`$ODBC_CONFIG --include-prefix`
		LDFLAGS="$LDFLAGS -L`$ODBC_CONFIG --lib-prefix`"
		# if not available do not use system default
		LDFLAGS="$LDFLAGS -L$with_unixodbc/lib"
	test -r "$ODBC_INC/sql.h" || AC_ERROR([sql.h not found])
	test -r "$ODBC_INC/sqlext.h" || AC_ERROR([sqlext.h not found])

IOW, you don't need odbc-config.  The configure script runs odbc-config,
if it finds it, to generate the INCLUDE string (in $ODBC_INC).  If it
doesn't find it, it looks around for header files.  Regardless,
--with-unixodbc overrides whatever it happens to find.  BUT: if you
specify --with-unixodbc=DIR *and* there's a DIR/bin/odbc_config, it runs
that to set the INCLUDE path.  (whew!)

Mine does this:

$ /usr/local/bin/odbc_config --include-prefix

>From what you said, I would expect one of two things:

1.  You (now) have /usr/bin/odbc-config which, when run with
--include-prefix, produces '/usr'.  But your gcc doesn't by default look
in /usr/include.  


2.  odbc-config is elsewhere on your path and produces something other
than '/usr', forcing you to override its output using --with-unixodbc.  

There are other possibilities, too, but they're not likely.  I'd bet on

> Also, I still received the same error message if I had the TDSVER set to
> 4.2. Setting the version to 8.0 cleared the issue up

Might be a protocol limitation.  

> Thanks again for the suggestion. That's another application I can cross
> off my list of reasons for still booting into my Windows XP virtual
> machine.

A happy camper, good news on a Saturday morning!  


More information about the FreeTDS mailing list