Mega Search
23.2 Million


Sign Up

Make a donation  
BDE and Builder 2007/2010  
News Group: embarcadero.public.bde.general

Hi,

I have been writing an application in C using Borland C++ 5.02 with a Paradox DB using the BDE API for a long time. Some of this I have converted to DLL's with VCL using TQuery into the Paradox DB.

I have decided that it is time to get rid of the 5.02 compiler so I have created a Builder project and imported the C code.

This C code has as its first include idapi.h which is not in Builder. A search revealed that this has been replaced with BDE.hpp.

Attempts to compile with BDE.hpp result in an error E2040 Declaration terminated incorrectly in sysmac.h which is brought in by BDE.hpp. This occurs in Builder 2007 and 2010.

The error occurs on the extern "C" { line of the following code snippet

extern "C" {
#pragma option push -vi

#undef GetDiskFreeSpaceEx
inline BOOL WINAPI
GetDiskFreeSpaceEx(LPCTSTR lpDirectoryName,
                   PULARGE_INTEGER lpFreeBytesAvailableToCaller,
                   PULARGE_INTEGER lpTotalNumberOfBytes,
                   PULARGE_INTEGER lpTotalNumberOfFreeBytes)
{
  return _MAP_WINNAME(GetDiskFreeSpaceEx)(lpDirectoryName,
                                          lpFreeBytesAvailableToCaller,
                                          lpTotalNumberOfBytes,
                                          lpTotalNumberOfFreeBytes);
}

#pragma option pop // -vi
} // extern "C"

So is there some way around this issue or do I need to dig out idapi.h and make it available to the project? This would defeat the desire to retire 5.02.

I have searched the internet and found no obvious answer.

And, yes I understand the BDE is deprecated.

Thanks
Denis

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 17-May-2012, at 4:42 AM EST
From: Denis Kahl
 
Re: BDE and Builder 2007/2010  
News Group: embarcadero.public.bde.general
> {quote:title=Denis Kahl wrote:}{quote}
> Hi,
> 
> I have been writing an application in C using Borland C++ 5.02 with a Paradox DB using the BDE API for a long time. Some of this I have converted to DLL's with VCL using TQuery into the Paradox DB.
> 
> I have decided that it is time to get rid of the 5.02 compiler so I have created a Builder project and imported the C code.
> 
> This C code has as its first include idapi.h which is not in Builder. A search revealed that this has been replaced with BDE.hpp.
> 
> Attempts to compile with BDE.hpp result in an error E2040 Declaration terminated incorrectly in sysmac.h which is brought in by BDE.hpp. This occurs in Builder 2007 and 2010.
> 
> The error occurs on the extern "C" { line of the following code snippet
> 
> extern "C" {
> #pragma option push -vi
> 
> #undef GetDiskFreeSpaceEx
> inline BOOL WINAPI
> GetDiskFreeSpaceEx(LPCTSTR lpDirectoryName,
>                    PULARGE_INTEGER lpFreeBytesAvailableToCaller,
>                    PULARGE_INTEGER lpTotalNumberOfBytes,
>                    PULARGE_INTEGER lpTotalNumberOfFreeBytes)
> {
>   return _MAP_WINNAME(GetDiskFreeSpaceEx)(lpDirectoryName,
>                                           lpFreeBytesAvailableToCaller,
>                                           lpTotalNumberOfBytes,
>                                           lpTotalNumberOfFreeBytes);
> }
> 
> #pragma option pop // -vi
> } // extern "C"
> 
> So is there some way around this issue or do I need to dig out idapi.h and make it available to the project? This would defeat the desire to retire 5.02.
> 
> I have searched the internet and found no obvious answer.
> 
> And, yes I understand the BDE is deprecated.
> 
> Thanks
> Denis

Well the solution to this was to change my xxx.c source files to xxx.cpp

So I have successfully compiled after a raft of changes in the calls to various BDE API functions.

The trouble now is the linker is getting "Unresolved external 'Bde::DbiPutField (....." issues.

I have tried switching the Dynamic RTL linker flag and including the bdertl.lib into the project. Neither helped.

Anybody able to assist with this?

Thanks
Denis

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 30-May-2012, at 12:52 AM EST
From: Denis Kahl