[freetds] mingw cross compilation (Frediano Ziglio)
James K. Lowden
jklowden at freetds.org
Mon Jan 12 11:44:03 EST 2009
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
More information about the FreeTDS
mailing list