Search code examples
c++corba

error MIDL2025 : syntax error : expecting an interface


I am compiling quite an old code using MS Studio 8 and getting quite an annoying error: error MIDL2025 : syntax error : expecting an interface name or DispatchInterfaceName or CoclassName or ModuleName or LibraryName or a type specification near "exception".

It is an *.idl:

#ifndef __UserCORBAException_IDL__
#define __UserCORBAException_IDL__

exception UserCORBAException {
    string xml;
};

#endif//__UserCORBAException_IDL__

It compiles using Studio 6.


Solution

  • It looks like you are compiling CORBA IDL with the Microsoft IDL compiler. They are separate languages, they just use the same file extension.

    I assume you are importing an existing project, and you have accepted the suggested tool to compile the file, however it is the wrong tool.

    You need to use the CORBA IDL compiler.