Skip to Content.
Sympa Menu

freetds - Re: [freetds] Cross compilation, warnings and errors

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Luis Lavena <luislavena AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Cross compilation, warnings and errors
  • Date: Mon, 24 Jan 2011 13:09:45 -0300

On Mon, Jan 24, 2011 at 12:42 PM, <jklowden AT schemamania.org> wrote:

Hello James,

> [snip]
>
> Me too!  Let me caution you, though.  None of the FreeTDS utilities use
> sqlfront.h, and all of them connect to Microsoft servers.  The header files
> are written in, um, source code, and everything I've just described can be
> learned from the sources.  By choosing to use sqlfront.h, you bought
> yourself headaches that could easily have been avoided.  Luckily for your
> users, though, you bumped into one early and showed up here!
>

Thank you for your complete and thoughtful response, but seems there
is a confusion.

Perhaps my english is not accurate, but what I pointed out is that
during FreeTDS cross compilation I received the compilation error, not
anything else.

That means FreeTDS headers are not evaluating for missing or defined
symbols prior to define their own.

Just to clarify, this is what I did:

$ wget
ftp://ftp.ibiblio.org/pub/Linux/ALPHA/freetds/current/freetds-current.tgz

$ tar xf freetds-current.tgz

$ cd freetds-0.83.dev.20110123/

$ mkdir build
$ cd build/

$ sh ../configure --disable-shared --enable-static --host=i686-w64-mingw32

First warning during configure:
checking odbcss.h usability... no
checking odbcss.h presence... yes
configure: WARNING: odbcss.h: present but cannot be compiled
configure: WARNING: odbcss.h: check for missing prerequisite headers?
configure: WARNING: odbcss.h: see the Autoconf documentation
configure: WARNING: odbcss.h: section "Present But Cannot Be Compiled"
configure: WARNING: odbcss.h: proceeding with the preprocessor's result
configure: WARNING: odbcss.h: in the future, the compiler will take precedence
configure: WARNING: ## ---------------------------------- ##
configure: WARNING: ## Report this to the FreeTDS lists. ##
configure: WARNING: ## ---------------------------------- ##
checking for odbcss.h... yes

It clearly states "Report this to the FreeTDS lists" which I did :)

Configure completes successfully, and proceed to make:

$ make
...

if i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../../src/apps
-I../../include -I../../../include -D_FREETDS_LIBRARY_SOURCE
-DUNIXODBC -D_REENTRANT -D_THREAD_SAFE -DDEBUG=1 -Wall
-Wstrict-prototypes -Wmissing-prototypes -Wno-long-long -g -O2
-Wdeclaration-after-statement -MT bsqldb.o -MD -MP -MF
".deps/bsqldb.Tpo" -c -o bsqldb.o ../../../src/apps/bsqldb.c; \
then mv -f ".deps/bsqldb.Tpo" ".deps/bsqldb.Po"; else rm -f
".deps/bsqldb.Tpo"; exit 1; fi
In file included from ../../../src/apps/bsqldb.c:52:0:
../../../include/sqlfront.h:39:30: error: conflicting type qualifiers
for ‘LPCBYTE’
/Users/luis/mingw/w32/bin/../lib/gcc/i686-w64-mingw32/4.5.2/../../../../i686-w64-mingw32/include/winscard.h:22:23:
note: previous declaration of ‘LPCBYTE’ was here
make[3]: *** [bsqldb.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1


As you can see, what fails is FreeTDS own make process, and is because
include/sqlfront.h defines in line 39:

typedef const LPBYTE LPCBYTE ;

Which is already defined in winscard.h, and sqlfront.h is included by
bsqldb.c, at line 52.

This also happens with VS2005, as this LPCBYTE redefinition error
returns lot of occurrences on Google (VS2005 windows.h includes
winscard.h, something that wasn't happening on VC6)

Please excuse if what you explained is what I'm saying above, but from
my understanding the conversation went on a different direction than
my questions.

I would happily contribute patches to ensure both compilation and
cross compilation works with MinGW, but I would prefer use GitUHb
mirror (if was updated)

Thank you.
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry




Archive powered by MHonArc 2.6.24.

Top of Page