Re: HOWTO compille FreeTDS under Windows

Frediano Ziglio <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
2010/9/16 LacaK <[email protected]>

> Hi James,
> thanks for reply. Let me explain in details my point of view ;-)
>
>  Ask yourself this: how does one create a DLL from nothing?  Search the Web
>> for examples/tutorials with "Win32 dll C".   In short, open the
>> flavor-of-the-day IDE, choose something like "create a DLL project" and
>> pretty soon, splat, you'll have boilerplate DLL code.  Compile.  Good.
>>
> I am coming from Delphi/FreePascal world, where things are bit different.
> (I use dblib.dll in FreePascal db access class, which uses db-lib api to
> comunicate with MS SQL Server)
>
>
>  Add dblib.lib to your project, and a .DEF file naming the dblib functions
>> (easily extracted from doc/api_status.txt).  Compile again.  Voila!  A
>> DLL.
>>
> Yes, DEF file is one missing things. I attach my DEF file. Do you think,
> that this file (dblib_w.def) can be added into FreeTDS sources - Win32
> directory ?
> (where already FreeTDS_w.def is) I hope, that it will be useful also for
> others who needs build dblib.dll.
> Second missing things are linker dependencies, which must be set to compile
> (+ws2_32.lib)
> I also attach modified Visual Studio project files, which adds dblib_dll
> (dynamic library) beside existing  dblib (static library).
> May be, that it is not perfect solution, but it is attempt to make building
> more user friendly.
>
> If it is not acceptable for you, then we can write somewhere HOWTO text
> file (it will be very useful for new users):
> How to compile FreeTDS under MS Visual Studio:
> ...
> 1. Change in project properties
>
> General
>  Configuration type: Dynamic library (instead of Static library)
> Linker
>  Input
>     Add dependencies: ws2_32.lib
>     Module definition: ..\dblib.def
>
>  Supporting the Windows development environment is a bit of a nuisance --
>> no offence intended! -- for a free software project because the setup is
>> so variable.  I wrote the FreeTDS NMakefile specifically to compile db-lib
>> regardless of the version of Visual Studio anyone might happen to use.  I
>> don't know now portable it really is, or if anyone uses it, but at least
>> if problems are found it can be patched.  A .dsw or .sln  or .vcproj file
>> cannot be patched, and likely as not won't work anyway.  Just the other
>> day I tried to compile APL for Windows and VS complained the project file
>> was for a newer version.  No simple remedy there.
>>
> Do you have any prefered compiler for Windows ? If yes, then project files
> can be optimized for that compiler (resp. tutorial can be written)
> Really I am not C/C++ expert, so I only share my experiences with you.
> I leave it up to you. If you can make things to be easyier for non C/C++
> programers then it will be welcome!
>
> L.
>
>
Nothing against the patch, committed. I used dblib.def filename
(FreeTDS_w.def is the wide version of FreeTDS.def), renamed output directory
to dbdll_Debug/dbdll_Release (under VC++ 2008 I had problems compiling both
static and dynamic library) and changes to Makefiles.

freddy77
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.