digitalmars.D.learn - ImportC GUID compilation problem with some Windows headers
- Carl Sturtivant (21/21) Mar 20 I'm running into this COM related issue with some Windows
- Carl Sturtivant (4/8) Mar 21 Has anyone successfully compiled an EXTERN_GUID declaration like
- Dave P. (6/15) Mar 21 I filed a bug for this:
- Carl Sturtivant (2/7) Mar 21 I'll give it a shot. Thanks for the bug report.
I'm running into this COM related issue with some Windows headers, in the case when each GUID is declared in such a file as follows. ```C EXTERN_GUID(IID_IBlahBlahBlah, 0xabcdef12, 0x11d2, 0xab3a, 0xc0, 0x4f, [...] ); ``` and ImportC which is compiling `blah.c` containing only a few macro definitions and a single include of a header file say <blah.h> encounters these and responds with ``` [...] waffle.h(123): Error: variable `waffle.IID_IBlahBlahBlah` extern symbols cannot have initializers ``` Presumably MSVC simply compiles such files, but DMD's ImportC is too strict to do so. I've worked around this in some very dirty and inconvenient ways, but am hoping for a real solution of some kind. I want to use some of these IIDs and CLSIDs so I need to make these declarations work in some fashion. Inclusions are nested so these may be far from the header file I am including in `blah.c`. Any help appreciated.
Mar 20
On Thursday, 21 March 2024 at 00:06:56 UTC, Carl Sturtivant wrote:```C EXTERN_GUID(IID_IBlahBlahBlah, 0xabcdef12, 0x11d2, 0xab3a, 0xc0, 0x4f, [...] ); ```Has anyone successfully compiled an EXTERN_GUID declaration like this in a Windows header with ImportC using some C macro trickery for example?
Mar 21
On Thursday, 21 March 2024 at 18:19:58 UTC, Carl Sturtivant wrote:On Thursday, 21 March 2024 at 00:06:56 UTC, Carl Sturtivant wrote:I filed a bug for this: https://issues.dlang.org/show_bug.cgi?id=24447 I haven’t tried on a windows box and this is just from me grepping through header files, but maybe try to `#define EXTERN_C` as nothing in the meantime?```C EXTERN_GUID(IID_IBlahBlahBlah, 0xabcdef12, 0x11d2, 0xab3a, 0xc0, 0x4f, [...] ); ```Has anyone successfully compiled an EXTERN_GUID declaration like this in a Windows header with ImportC using some C macro trickery for example?
Mar 21
On Thursday, 21 March 2024 at 22:33:17 UTC, Dave P. wrote:I filed a bug for this: https://issues.dlang.org/show_bug.cgi?id=24447 I haven’t tried on a windows box and this is just from me grepping through header files, but maybe try to `#define EXTERN_C` as nothing in the meantime?I'll give it a shot. Thanks for the bug report.
Mar 21