G'day everyone
I'm a newbie to C++ and even more so to Borland Turbo C++ Explorer. I've just encountered this compile error. Any clues as to how to fix it?
[C++ Error] comsvcs.h(3209): E2015 Ambiguity between 'ITransaction' and 'Oledb::ITransaction'
[C++ Error] comsvcs.h(3275): E2015 Ambiguity between 'ITransaction' and 'Oledb::ITransaction'
[C++ Error] comsvcs.h(16197): E2015 Ambiguity between 'ITransaction' and 'Oledb::ITransaction'
[C++ Error] comsvcs.h(16293): E2015 Ambiguity between 'ITransaction' and 'Oledb::ITransaction'
The code where the first one occurs is
EXTERN_C const IID IID_ICreateWithTransactionEx;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("455ACF57-5345-11d2-99CF-00C04F797BC9")
ICreateWithTransactionEx : public IUnknown
{
public:
virtual /* [helpstring][helpcontext] */ HRESULT STDMETHODCALLTYPE CreateInstance(
/* [in] */ ITransaction *pTransaction,
/* [in] */ REFCLSID rclsid,
/* [in] */ REFIID riid,
/* [iid_is][retval][out] */ void **pObject) = 0;
};
A couple of suggestions from another source:
As the error message of the compiler tells there are 2 declarations of the ITransaction datatype in scope of the compilation unit. It seems the the ITransaction definition comes from Microsoft's comsvcs.h and that the OleDB::ITransaction is a implementation of the ITransaction interface from Borland. So you could try 2 things:
- eliminate the OleDB::ITransaction definition (don't know Turbo C++, but there may be a component dealing with oleDB. Try to get rid of this. Or it may be included by using another #include. Search for the text oledb::ITransaction in your include directory and you will hopefully find the relevant file. Modify the include path so it is not included any more).
- you could try to define CINTERFACE because the code resulting in the compile error will not be included if this is defined. But that may cause other problems...
Does anyone have any other suggestions?
Kind regards, Bruce.