Borland Dev Studio 2006 Turbo C ++ Explorer problem

G'day everyone

I am new to C ++ and even more so to Borland Turbo C ++ Explorer. I just ran into this compilation error. Any hints on how to fix this?

[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 in which the first occurs is

EXTERN_C const IID IID_ICreateWithTransactionEx;

#if defined(__cplusplus) && !defined(CINTERFACE)

    ICreateWithTransactionEx : public IUnknown
    virtual /* [helpstring][helpcontext] */ HRESULT STDMETHODCALLTYPE CreateInstance(
        /* [in] */ ITransaction *pTransaction,
        /* [in] */ REFCLSID rclsid,
        /* [in] */ REFIID riid,
        /* [iid_is][retval][out] */ void **pObject) = 0;



Several suggestions from another source:

As reported in the compiler error message, there are 2 ITransaction data type declarations in the compilation scope. It seems the definition of ITransaction comes from Microsoft comsvcs.h and that OleDB :: ITransaction is Borland's implementation of the ITransaction interface. So, you can try 2 things:

  • exclude definition of OleDB :: ITransaction (don't know Turbo C ++, but there might be a component dealing with oleDB. Try to get rid of that. Or it can be included with another #include. oledb :: ITransaction in your include directory, and you hopefully find the appropriate file. Change the include path so it is no longer included).
  • you can try to define CINTERFACE because the code causing the compilation error will not be included if defined. But this can cause other problems ...

Does anyone have any other suggestions?

Regards, Bruce.


source to share

2 answers

I have no idea how to do COM or what your ITransaction is, but it seems to me that your scope contains two types of ITransaction. Can you be more explicit in your function prototype? Can you cover the IT interoperability you want to use? Say ":: ITransaction" (to use the global namespace) or "some_other_namespace :: ITransaction"?



Ok, we need to close this issue somehow. After updating Turbo C ++ Explorer with the latest fixes, the problem went away.

Thanks to everyone who offered suggestions along the way.



All Articles