Re: [Mingw-w64-public] Using midl/widl with MinGW

2020-05-02 Thread Biswapriyo Nath
Looking at the errors, it seems that the code is missing some include
headers. For example, IUnknown_QueryInterface_Proxy is in unknwnbase.h and
IRpcStubBufferVtbl is in objidlbase.h.Try to add `import "unknwn.idl";` in
the IDL file that you want to compile. If you have a simple, minimal,
reproducible code example[1] please provide it. It will help to debug the
issue quickly.

And for msys2, check if you've installed mingw-w64-x86_64-toolchain (i686
for 32bit) group package properly.


Mingw-w64-public mailing list

[Mingw-w64-public] Using midl/widl with MinGW

2020-05-02 Thread Björn Schäpers | MIMOT GmbH

I'm trying to migrate our software to mingw and we have multiple (D)COM 
interfaces in use.

Right now we use official midl, make some modifications to the generated files, 
and compile it with Embarcaderos Compilers (the classic Borland one, and the 
newer Clang based one).
For mingw I use msys2.

I did try to run midl using the IDL files and headers from mingw.
The first problem was the __debugbreak function in _mingw.h, but that can be 
addressed with some #ifdef'ery.

Then when I try to compile the proxy DLL I get a lot of warnings (have not 
looked deeply into them), the error(s) I get are:
'IUnknown_QueryInterface_Proxy' undeclared here (not in a function)

Looking a bit into it, I started adding defines: WIDL_C_INLINE_WRAPPERS and 
COBJMACROS, the next problem is:
C:\msys64\mingw32\i686-w64-mingw32\include\unknwnbase.h:152: Error: multiple 
storage classes in declaration specifiers
It's from the expansion of FORCEINLINE in C mode.

Compiling the sources as C++ (by renaming them), I get:
C:\msys64\mingw32\i686-w64-mingw32\include\rpcproxy.h:91: Error: 
'IRpcStubBufferVtbl' does not name a type; did you mean 'IRpcStubBuffer'?

Then I learned there is widl and tried that. But the generated files are no 
good to me:
Error: wine/exception.h: No such file or directory

As far as I can tell, there is no package within msys2 where I could get 

So now my question is:
How to run generate the proxy DLL for a COM interface with mingw? I'm willing 
to put some effort into it, if there are parts missing in mingw.

Mit freundlichen Grüßen
With Best Regards

Björn Schäpers
Entwicklung Systemsoftware
Berner Weg 11
D-79539 Lörrach
T  +49  (0)7621/95780
F +49 (0)7621/957810
Diese E-Mail und ihr Inhalt sind nicht rechtsverbindlich, solange dies nicht 
ausdrücklich schriftlich durch die MIMOT GmbH bestätigt wurde.
Die übermittelten Informationen unterliegen der Geheimhaltung und sind 
ausschließlich für den oben bezeichneten Adressaten bestimmt. Falls Sie diese 
Mitteilung irrtümlich erhalten haben, geben sie uns bitte sofort Bescheid.

This e-mail and its content is not legally binding as long as not explicitly 
confirmed in writing by MIMOT GmbH.
The information contained is confidential and intended for the exclusive use by 
the addressee designated above. If you have received this message by mistake, 
please contact us immediately.


MIMOT GmbH, Berner Weg 11, D-79539 Lörrach, Telefon +49-7621-9578-0, Telefax 
Geschäftsführer: Jürgen Philipp • Amtsgericht Freiburg HRB 705553 • UST-ID-Nr. 
DE 272524976

Mingw-w64-public mailing list