Re: [Mingw-w64-public] Using midl/widl with MinGW
Hi Björn, On 02.05.2020 09:42, Björn Schäpers | MIMOT GmbH wrote: 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 wine/exception.h You may try to use interpreted stubs, those should not need exceptions. Please try -Oif widl option. midl uses this mode by default, we should probably change widl to do the same at some point as well. Jacek ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] Using midl/widl with MinGW
> -Ursprüngliche Nachricht- > Von: Björn Schäpers | MIMOT GmbH [mailto:bjoern.schaep...@mimot.de] > Gesendet: Dienstag, 5. Mai 2020 07:51 > An: mingw-w64-public@lists.sourceforge.net > Betreff: Re: [Mingw-w64-public] Using midl/widl with MinGW > > -Ursprüngliche Nachricht- > Von: Biswapriyo Nath [mailto:nathbap...@gmail.com] > Gesendet: Samstag, 2. Mai 2020 10:47 > An: mingw-w64-public@lists.sourceforge.net > Betreff: Re: [Mingw-w64-public] Using midl/widl with MinGW > > 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. > > [1]: https://stackoverflow.com/help/minimal-reproducible-example > > Hi, > > although I do not have unknwn.idl directly imported, it is imported through > the oaidl.idl. The same (from midl) generated code compiles fine with > Embarcaderos compiler, which uses its own headers. They are nearly > identical to those from the windows sdk. > > My minimum example is attached, when I ran the response file with "MIDL > Compiler Version 8.01.0622" the initial error is: > C:/msys64/mingw32/i686-w64-mingw32/include/_mingw.h(581) : error > MIDL2025 : syntax error : expecting a type specification or a storage specifer > or a type qualifier near "__inline__" > I've attached the patch to fix this. > > With gcc dlldata.c proxy.c example_i.c I still get > 'IUnknown_QueryInterface_Proxy' undeclared here (not in a function) > > Adding -DWIDL_C_INLINE_WRAPPERS -DCOBJMACROS spams a lot of similar > errors: > c:/msys64/mingw32/i686-w64-mingw32/include/unknwnbase.h:152:1: error: > multiple storage classes in declaration specifiers > 152 | static FORCEINLINE HRESULT IUnknown_QueryInterface(IUnknown* > This,REFIID riid,void **ppvObject) { Precompiled (also attached) this results > to static extern __inline__ > __attribute__((__always_inline__,__gnu_inline__)) HRESULT > IUnknown_QueryInterface(IUnknown* This,const IID *const riid,void > **ppvObject) { > > Compiling it with g++ results in the same errors I've mentioned in the initial > message. > > When I compile the Code with bcc32c (the Clang based Embarcadero > Compiler) it compiles (and runs, because that's what we use right now). I've > also attached the command line for bcc32c which is rather long. You may > notice -DWIN32 and -DREGISTER_PROXY_DLL, I've also tried to add that to > the gcc call which doesn't change anything. > > With widl the wine headers are obviously still missing. > > There is no package called "mingw-w64-x86_64-toolchain", so I assume you > just meant the toolchain. I've mingw32/mingw-w64-i686- > {gcc|gdb|make|tools-git} and many more. The same for 64 Bit, but right now > I focused on 32 Bit. Are there any other packages I need? I think my compiler > is running fine, because I've already compiled Qt, LLVM, qbs, QtCreator, and > some other programs. > > [1] Precompiled with GCC: https://nopaste.nl/EbYeIl8bvy [2] Precompiled > with GCC and -DWIDL_C_INLINE_WRAPPERS -DCOBJMACROS: > https://nopaste.nl/4NwyiSWFmu [3] Precompiled with bcc32c: > https://nopaste.nl/T1N52sHZP4 > > > --- > Mit freundlichen Grüßen > With Best Regards > > Björn Schäpers > Entwicklung Systemsoftware > > Mimot GmbH > --- > > > > __ > > MIMOT GmbH, Berner Weg 11, D-79539 Lörrach, Telefon +49-7621-9578-0, > Telefax +49-7621-9578-10, www.mimot.com > Geschäftsführer: Jürgen Philipp • Amtsgericht Freiburg HRB 705553 • UST-ID- > Nr. DE 272524976 > > ___ > Mingw-w64-public mailing list > Mingw-w64-public@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public Hi, I just wonder: Is this the correct mailing list, or is there another one better suited for my question? Or is there a forum where I should go? Or am I on my own? --- Mit freundlichen Grüßen With Best Regards Björn Schäpers Entwicklung Systemsoftware Mimot GmbH --- __ MIMOT GmbH, Berner Weg 11, D-79539 Lörrach, Telefon +49-7621-9578-0, Telefax +49-7621-9578-10, www.mimot.com Geschäftsführer: Jürgen Philipp • Amtsgericht Freiburg HRB 705553 • UST-ID-Nr. DE 272524976 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] Using midl/widl with MinGW
-Ursprüngliche Nachricht- Von: Biswapriyo Nath [mailto:nathbap...@gmail.com] Gesendet: Samstag, 2. Mai 2020 10:47 An: mingw-w64-public@lists.sourceforge.net Betreff: Re: [Mingw-w64-public] Using midl/widl with MinGW 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. [1]: https://stackoverflow.com/help/minimal-reproducible-example Hi, although I do not have unknwn.idl directly imported, it is imported through the oaidl.idl. The same (from midl) generated code compiles fine with Embarcaderos compiler, which uses its own headers. They are nearly identical to those from the windows sdk. My minimum example is attached, when I ran the response file with "MIDL Compiler Version 8.01.0622" the initial error is: C:/msys64/mingw32/i686-w64-mingw32/include/_mingw.h(581) : error MIDL2025 : syntax error : expecting a type specification or a storage specifer or a type qualifier near "__inline__" I've attached the patch to fix this. With gcc dlldata.c proxy.c example_i.c I still get 'IUnknown_QueryInterface_Proxy' undeclared here (not in a function) Adding -DWIDL_C_INLINE_WRAPPERS -DCOBJMACROS spams a lot of similar errors: c:/msys64/mingw32/i686-w64-mingw32/include/unknwnbase.h:152:1: error: multiple storage classes in declaration specifiers 152 | static FORCEINLINE HRESULT IUnknown_QueryInterface(IUnknown* This,REFIID riid,void **ppvObject) { Precompiled (also attached) this results to static extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) HRESULT IUnknown_QueryInterface(IUnknown* This,const IID *const riid,void **ppvObject) { Compiling it with g++ results in the same errors I've mentioned in the initial message. When I compile the Code with bcc32c (the Clang based Embarcadero Compiler) it compiles (and runs, because that's what we use right now). I've also attached the command line for bcc32c which is rather long. You may notice -DWIN32 and -DREGISTER_PROXY_DLL, I've also tried to add that to the gcc call which doesn't change anything. With widl the wine headers are obviously still missing. There is no package called "mingw-w64-x86_64-toolchain", so I assume you just meant the toolchain. I've mingw32/mingw-w64-i686-{gcc|gdb|make|tools-git} and many more. The same for 64 Bit, but right now I focused on 32 Bit. Are there any other packages I need? I think my compiler is running fine, because I've already compiled Qt, LLVM, qbs, QtCreator, and some other programs. [1] Precompiled with GCC: https://nopaste.nl/EbYeIl8bvy [2] Precompiled with GCC and -DWIDL_C_INLINE_WRAPPERS -DCOBJMACROS: https://nopaste.nl/4NwyiSWFmu [3] Precompiled with bcc32c: https://nopaste.nl/T1N52sHZP4 --- Mit freundlichen Grüßen With Best Regards Björn Schäpers Entwicklung Systemsoftware Mimot GmbH --- __ MIMOT GmbH, Berner Weg 11, D-79539 Lörrach, Telefon +49-7621-9578-0, Telefax +49-7621-9578-10, www.mimot.com Geschäftsführer: Jürgen Philipp • Amtsgericht Freiburg HRB 705553 • UST-ID-Nr. DE 272524976 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] Using midl/widl with MinGW
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. [1]: https://stackoverflow.com/help/minimal-reproducible-example ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
[Mingw-w64-public] Using midl/widl with MinGW
Hi, 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 wine/exception.h 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 - MIMOT GmbH Berner Weg 11 D-79539 Lörrach T +49 (0)7621/95780 F +49 (0)7621/957810 bjoern.schaep...@mimot.de Internet: http://www.mimot.de/ - 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 +49-7621-9578-10, www.mimot.com Geschäftsführer: Jürgen Philipp • Amtsgericht Freiburg HRB 705553 • UST-ID-Nr. DE 272524976 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public