PRSQL9108001: L2029 on DBERRHANDLE and DBMSGHANDLE with /Gc

ID Number: Q75189

1.10

OS/2

Summary:

Problem ID: PRSQL9108001

SYMPTOMS

When compiling a DB-LIBRARY (dblib) application with the /Gc

compiler option to use the Pascal calling convention, the linker

returns the following errors:

error L2029: 'DBERRHANDLE' : unresolved external

error L2029: 'DBMSGHANDLE' : unresolved external

CAUSE

The dberrhandle() and dbmsghandle() DB-LIBRARY functions are not

prototyped correctly for use with programs compiled with the Pascal

calling convention.

WORKAROUND

If possible, do not compile the application with the /Gc switch. If

that is not possible, modify the SQLDB.H header file shipped with

DB-LIBRARY.

Change the following two lines

extern INT (API *dberrhandle( INT (API *)(parameters...)))();

extern INT (API *dbmsghandle( INT (API *)(parameters...)))();

to read as follows:

extern INT (API * cdecl dberrhandle( INT (API *)(parameters...)))();

extern INT (API * cdecl dbmsghandle( INT (API *)(parameters...)))();

STATUS

Microsoft has confirmed this to be a problem in DB-LIBRARY version

1.16. Microsoft is researching this problem and will post new

information here as it becomes available.