Subject Re: [firebird-support] Re: building a DLL and trying to use gcc
Author Ray Holme
OK, sorry if I confused you but welcome to the confused masses.

You asked if I used C or C++ - the answer is C.

You asked how I declared the firebird functions in my code:
my answer was using firebird includes: ibase.h and ib_util.h
I pointed out that my compile uses "-DWIN32" so the version
of the functions with "__stdcall" is generated (I showed it)

I have also tried a lot of other things includeing __cdecl (not
compatible with __stdcall. I also tried nothing for EXPORT (and

I have also sent you (and others) privately the entire source but your
email has problems - I sent a copy of the bouncing to Roman to give to

Anyway, to review - I am compiling on Windows 7 using GCC (a 32 bit
compiler on a 64 bit machine). Attached are a pared down MINIMAL set of
the udf code, the compile batch file, and the results. I have tried many
flavors of compile switches (WIN32, GNUC, BORLAND ...) - none are happy
with the provided firebird libraries. I will next try analyzing the
libraries using pexport unless you have a better idea.

I stress that the attached source is MINIMAL - just enough to force the
two calls causing problems. The rest you can get (if you want from Paul
Beach or Dmitry).


PS - all attached files are in Microsoft line ending format.


gcc -c -I "C:/Program Files/Firebird/Firebird_2_5/include" -DWIN32 -o sample.o sample.c
gcc -shared -L "C:/Program Files/Firebird/Firebird_2_5/lib" -o sample.dll sample.o ^
fbclient_ms.lib ib_util_ms.lib -Wl,--export-all-symbols -Wl,--enable-auto-import

E:\ray\for_vlad>gcc -c -I "C:/Program Files/Firebird/Firebird_2_5/include" -DWIN32 -o sample.o sample.c

E:\ray\for_vlad>gcc -shared -L "C:/Program Files/Firebird/Firebird_2_5/lib" -o sample.dll sample.o ^
fbclient_ms.lib ib_util_ms.lib -Wl,--export-all-symbols -Wl,--enable-auto-import
gcc: fbclient_ms.lib: No such file or directory
gcc: ib_util_ms.lib: No such file or directory

[Non-text portions of this message have been removed]