Linking Errors when using InterBase API with C++Builder 3

By: Borland Staff

Abstract: The C++Builder incremental linker prepends an underscore to the InterBase API functions. The gds32.dll does not export these functions with an underscore, thus the Unresolved external error message.

Problem:
When I try to use the InterBase API in a C++Builder 3 
project I get Linker errors like the following: [LinkerError] 
Unresolved external '_isc_start_transaction' referenced from ...

A few of the InterBase API functions are defined in 
ibase.h using the  __cdecl calling convention.  The 
C++Builder incremental linker prepends an underscore 
to these functions.   The gds32.dll does not export these 
functions with an underscore, thus the Unresolved external 
error message.


Solution:
One solution is to add a module definition file to your project that 
creates an alias for the function.

Here is an example .def file that resolves the error for the 
isc_start_transaction function

--------------------- begin .def file -----------------------------

IMPORTS
	_isc_start_transaction = GDS32.isc_start_transaction

--------------------- end .def file -----------------------------

Server Response from: ETNASC03