PellesC_V13\Include\Win\ocidl.h

Started by John Z, December 08, 2025, 07:36:57 PM

Previous topic - Next topic

John Z

Major issue  -  programs that previously compiled OK are now crashing out of compile if ocidl.h is included. 

Tested on two different windows 11 systems using known good projects.  I even unarchived a prior build and tried to rebuild it - same result, bad.
C:\Program Files\PellesC_V13\Include\Win\ocidl.h(25): error #2158: Unrecognized type 'interface' (did you mean: ?).
C:\Program Files\PellesC_V13\Include\Win\ocidl.h(25): error #2119: Redeclaration of 'IEnumConnections', previously declared at C:\Program Files\PellesC_V13\Include\Win\ocidl.h(25).
.
.
.
C:\Program Files\PellesC_V13\Include\Win\ocidl.h(190): fatal error #2210: More than 100 errors, please improve yourself.


Looks like every function in ocidl.h is throwing an error example below and full list in the attachment.

Removed and reinstalled V13 on the main system as well even though 2nd laptop now shows the issue too.
I've built the program for many years and no recent changes to it since May - when it was rebuilt.

Unfortunately I suspect a WIN 11 24H2 update -

Any thoughts welcome, also if someone can try -
I'm on Windows 11 Home, 24H2 OS build 26100.7171 and updates in the image below.  I think anything in October could be contributing... otherwise I have no idea.

Sadly,
John Z

Vortex

Not sure if it could help but Frankie's SDK for PellesC offers another version of ocidl.h :

https://github.com/Frankie-PellesC/fSDK
Code it... That's all...

John Z

Thanks an idea, appreciate it.  I do use Frankie's fGdiPlusFlat.h

Here is the kicker -
It complies ok on Win7 Pelles V12 just did it, so I uninstalled V12 and put on V13 now same error Win 7. Uninstalled V13 installed V12 - all good again on WIN7 .

Conclusion It must be something subtle that I did :( that V12 lets slide, even though I'm
sure my 5/18/2025 release was done with V13.  Soooo I'll unarchive some older, older versions.


I certainly can't say WIN 11 when my Win 7 Pro does it too....
I'll try V12 on WIN11 if I can't figure out anything else.

Thanks for the reply post Vortex.

John Z
 

TimoVJL

#3
This example compiled normally
// test_ocidl.h
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
//#include <ole2.h>
#include <objbase.h>
#include <ocidl.h>

void __cdecl mainCRTStartup(void)
{
ExitProcess(0);
}
May the source be with you

John Z

Thanks Timo,

I'll give this a try on my system.

John Z

John Z

Interesting -


What I found is that it appears that in Pelles V13 objbase.h is a mandatory prerequisite for using ocidl.h.

I added ocidl.h to the zsizer demo program and it failed compile with the same error messages.  Following Timo's example program I added objbase.h before ocidl.h and it compiles just fine, no errors

Change the order and put objbase.h after ocidl.h and it again fails with all of the error messages.

In Pelles V12 this is NOT the case, ocidl.h could be referenced alone. 

The two versions of ocidl.h are substantially different, but both insert needed additional .h files.
IMO if ocidl.h fails miserably without objbase.h being referenced first, shouldn't ocidl.h first check if objbase.h has been referenced and if not #include it at the start?

In any case thanks Timo for the example it showed a method to a fix.

John Z

Vortex

Sometimes, it's better to copy the confusing equates from the net and paste them to the source file. In this case, you have to omit the header file.
Code it... That's all...

TimoVJL

A that ocidl.h don't have usual safe guard for windows.h and ole2.h
Perhaps have a good reason for that.
May the source be with you