Skip to Content.
Sympa Menu

freetds - Re: [freetds] mingw cross compilation (Frediano Ziglio)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT freetds.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] mingw cross compilation (Frediano Ziglio)
  • Date: Mon, 12 Jan 2009 11:44:03 -0500

Thomas Stover wrote:
> Although this maybe obvious to some, it took some head
> scratching for me. You have to initialize winsock!! Also add the library
>
> for winsock when building so "-lsysbdb -lws2_32".

Oh, that sounds like a bug. Normal Win32 db-lib and ODBC applications
don't need to initialize winsock.

This could be handled in tds_alloc_context(). It is called by the
initialization functions of all three client libraries.

One way would be to call, say, WSAEnumProtocols() looking for the error
WSANOTINITIALISED. If that error is returned, call WSAStartup() and try
again. If that fails, the function fails.

Patches welcome! :-)

--jkl




Archive powered by MHonArc 2.6.24.

Top of Page