Subject Re: [firebird-support] Port Linux app to Win32
Author Helen Borrie
At 12:56 AM 13/10/2007, you wrote:
>I've got an application running great on Linux which uses the Interbase
>API to access our Firebird database. Now I am required to port this app
>to Windows.
>
>I guess my question is, which compiler is required to do this? I have
>cygwin's gcc currently running. I don't have MSVC or Borland and would
>prefer to stay away from those. But if I need to, well then I need to.

Someone else could comment on any traps with non-MS compilers. But,
regardless of what compiler you use to compile your applications, on
Windows servers and clients you need the MS C and C++ runtimes in
order to use Firebird. Usually, they have already been installed by
other applications but, if not, there are copies in current Firebird
releases that you could gamble with; or you could do the more robust
thing and install the runtime packages from the MS site. From
Firebird 2 onward, you also need the ICU libraries, which can be
installed or updated from Firebird's icu sub-directory.

>If I can use cygwin (or perhaps even mingw), how can I correctly link
>against fbclient.dll? I've tried but of course I've come across the
>dreaded __stdcall convention issues.

Application code shouldn't be trying to statically link the dynamic
client library. Is that what your Linux application does?

>So I'm either completely missing the obvious (as usual) or I just
>haven't found the correct thread(s) or documentation to help out.

If you're determined to stick with the unwrappered API then you'll
need the InterBase 6 beta docs volume, ApiGuide.pdf. You can find
links to downloads in the Documentation Index at the Firebird website
( http://firebirdsql.org/index.php?op=doc )

>Hopefully someone here can point me in the right direction.

Does your Linux application use ibase.h and iberror.h as
includes? They are the header files for the API and the
exceptions. You can find them in the /include/ directory of the
appropriate Firebird or InterBase installation. ibase.h contains all
the API function prototypes, structure typedefs, parameter
definitions and macros that the various API functions need. (There
is also some sample code in the /examples/api/ subdir.)

If you want to consider using platform-independent c++ wrappers for
all of the API functions, etc., visit http://www.ibpp.org/ and/or
google for 'IBPP'. Even if recoding isn't on your horizon at the
moment, the reference and sample material at that site could possibly
help you into a zone of comfort...

./heLen