Skip to Content.
Sympa Menu

freetds - Re: [freetds] FreeTDS build issues

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddy77 AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] FreeTDS build issues
  • Date: Fri, 17 Feb 2012 17:52:35 +0100

2012/2/16 David Venus <david.venus AT bi-lo.com>:
> Hi!
>
> I am trying to build the current 0.91 stable (also tried 091 patched)
> release on AIX 7.1 using GCC 4.6.1 and unixODBC 2.3.2. Are FreeTDS 0.91 and
> unixODBC-2.3.2 compatible?
>

2.3.2 ?? latest should be 2.3.1!

> The previous error was that "unixodbc_conf.h" could not be found and I
> copied it from the top level unixODBC-2.3.2 directory to the unixODBC-2.3.2
> include directory. I mention this in case that was the wrong thing to do.
> :) [Please see the note below about $(prefix)/include not being used]
>

unixodbc_conf.h should be installed by "make install" (or packaged in
devel package)

> The errors I am getting now are in compiling odbc.c.
>
> Here are the commands I used to configure FreeTDS. Could this be part of
> the problem?
>
> ./configure \
> --prefix=/opt/oracle/local --enable-msdblib \
> --with-tdsver=7.0 --with-unixodbc=/opt/oracle/
> local/unixODBC-2.3.2
>
> Here are the actual errors that I am getting:
>
> In file included from odbc.c:54:0:
> ../../include/tdsodbc.h:650:2: error: #error SIZEOF_SQLWCHAR not supported
> !!

:( SIZEOF_SQLWCHAR should be always 2 or 4, defined by our configure
script in include/config.h, in my laptop (Ubuntu 11.10)

$ grep SQLWCHAR include/config.h
/* The size of `SQLWCHAR', as computed by sizeof. */
#define SIZEOF_SQLWCHAR 2


> odbc.c:2201:1: error: conflicting types for 'SQLColAttribute'
> /opt/oracle/local/unixODBC-2.3.1/include/sql.h:609:24: note: previous
> declaration of 'SQLColAttribute' was here
> odbc.c: In function '_SQLFetch':
>
> I am not sure what to do about the SIZEOF_SQLWCHAR error. Could it be a
> problem in my unixODBC build?
>

Could be, look at FreeTDS configure script, post the log (config.log).

> Here is what I found when I compared the sql.h include file and the odbc.c
> file:
>
> sql.h line 609:
> SQLRETURN  SQL_API SQLColAttribute(SQLHSTMT StatementHandle,
>                                   SQLUSMALLINT ColumnNumber,
>                                   SQLUSMALLINT FieldIdentifier,
>                                   SQLPOINTER CharacterAttribute,
>                                   SQLSMALLINT BufferLength,
>                                   SQLSMALLINT *StringLength,
>                                   SQLLEN *NumericAttribute );
>
> odbc.c
> static SQLRETURN _SQLColAttribute(SQLHSTMT hstmt,
>                                  SQLUSMALLINT icol,
>                                  SQLUSMALLINT fDescType,
>                                  SQLPOINTER rgbDesc,
>                                  SQLSMALLINT cbDescMax,
>                                  SQLSMALLINT FAR *pcbDesc,
>                                  SQLLEN FAR *pfDesc _WIDE);
>
> The last 2 arguments appear to be different.
>

Usually FAR is an empty define in *nix so there should be no problem.

> Also there are a number of messages like this:
>
> odbc.c: In function 'odbc_stat_execute':
> odbc.c:7005:18: warning: variable 'convert' set but not used
> [-Wunused-but-set-variable]
>
> Are these something to worry about?
>

I think these warnings are not so important, errors are!

> ---------------------------------------------------
>
> This is a follow up question to my questions above about building
> FreeTDS-091 stable on AIX 7.1. When I run configure SQLWCHAR is getting set
> to 0! What would cause this? I believe this is the cause of the error that
> I get which says SQLWCHAR not set.
>

Usually this means that type is not defined!

> Has anyone seen a problem with the "-prefix" option to configure? It
> appears when I try to build FreeTDS 91 that the $(prefix)/include and
> $(prefix)/lib are not being included in "-I" and "-L" parameters. The path
> "../../include" is being passed but $(prefix)/include would be
> "../../../include" or the full path name which is
> "/opt/oracle/local/include". I don't see either of these being passed.
>

No, --prefix are used for installation, you should see some
-I/opt/oracle/local/unixODBC-2.3.2/include from --with-unixodbc.

> Any hints, tips, suggestions are gratefully welcomed!
>
> This is AIX 7.1 using GCC 4.6.1
>
> -----------------------------------------------------------------
>
> Thanks for your time, help and patience!
>
> Dave Venus




Archive powered by MHonArc 2.6.24.

Top of Page