Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: Clash on June 05, 2007, 03:42:38 pm

Title: Weird error in unknwn.h and objidl.h error after including a certain file
Post by: Clash on June 05, 2007, 03:42:38 pm
Hello guys!
I have no idea why, but after doing an include I get a huge error inside codeblocks includes.
And oh I'm on the Windows Version 1.0 RC2 - Build: Oct 24 2005, 23:49:28

This is the error I get is:
Quote
Project   : Underio
Compiler  : GNU GCC Compiler (called directly)
Directory : C:\Arquivos de programas\Irrlicht\examples\Underio\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: CLevel.cpp
In file included from C:/Arquivos de programas/CodeBlocks/include/objbase.h:73,
                 from C:/Arquivos de programas/CodeBlocks/include/ole2.h:9,
                 from C:/Arquivos de programas/CodeBlocks/include/windows.h:111,
                 from C:/Arquivos de programas/CodeBlocks/include/winsock2.h:22,
                 from ../../include/CConnect.h:6,
                 from ../../include/CLevel.h:34,
                 from CLevel.cpp:1:
C:/Arquivos de programas/CodeBlocks/include/unknwn.h:31: error: expected init-declarator before '*' token
C:/Arquivos de programas/CodeBlocks/include/unknwn.h:31: error: expected `,' or `;' before '*' token
C:/Arquivos de programas/CodeBlocks/include/unknwn.h:38: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/unknwn.h:42: error: `LPUNKNOWN' has not been declared
C:/Arquivos de programas/CodeBlocks/include/unknwn.h:47: error: `IUnknown' was not declared in this scope
C:/Arquivos de programas/CodeBlocks/include/unknwn.h:47: error: expected primary-expression before ',' token
C:/Arquivos de programas/CodeBlocks/include/unknwn.h:47: error: expected primary-expression before "const"
C:/Arquivos de programas/CodeBlocks/include/unknwn.h:47: error: expected primary-expression before "void"
C:/Arquivos de programas/CodeBlocks/include/unknwn.h:47: error: initializer expression list treated as compound expression
C:/Arquivos de programas/CodeBlocks/include/unknwn.h:49: error: `IUnknown' was not declared in this scope
C:/Arquivos de programas/CodeBlocks/include/unknwn.h:49: error: expected primary-expression before ')' token
C:/Arquivos de programas/CodeBlocks/include/unknwn.h:51: error: `IUnknown' was not declared in this scope
C:/Arquivos de programas/CodeBlocks/include/unknwn.h:51: error: expected primary-expression before ')' token
C:/Arquivos de programas/CodeBlocks/include/unknwn.h:53: error: `IUnknown' has not been declared
C:/Arquivos de programas/CodeBlocks/include/unknwn.h:57: error: `IUnknown' has not been declared
C:/Arquivos de programas/CodeBlocks/include/unknwn.h:58: error: `IUnknown' has not been declared
In file included from C:/Arquivos de programas/CodeBlocks/include/objbase.h:74,
                 from C:/Arquivos de programas/CodeBlocks/include/ole2.h:9,
                 from C:/Arquivos de programas/CodeBlocks/include/windows.h:111,
                 from C:/Arquivos de programas/CodeBlocks/include/winsock2.h:22,
                 from ../../include/CConnect.h:6,
                 from ../../include/CLevel.h:34,
                 from CLevel.cpp:1:
C:/Arquivos de programas/CodeBlocks/include/objidl.h:34: error: `LPUNKNOWN' does not name a type
C:/Arquivos de programas/CodeBlocks/include/objidl.h:108: error: expected `;' before '*' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:166: error: `LPUNKNOWN' does not name a type
C:/Arquivos de programas/CodeBlocks/include/objidl.h:417: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:418: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:419: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:420: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:421: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:422: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:423: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:424: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:425: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:425: error: `IUnknown' has not been declared
C:/Arquivos de programas/CodeBlocks/include/objidl.h:431: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:464: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:480: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:491: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:507: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:529: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:542: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:568: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:572: error: `LPUNKNOWN' has not been declared
C:/Arquivos de programas/CodeBlocks/include/objidl.h:575: error: `LPUNKNOWN' has not been declared
C:/Arquivos de programas/CodeBlocks/include/objidl.h:585: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:589: error: `LPUNKNOWN' has not been declared
C:/Arquivos de programas/CodeBlocks/include/objidl.h:590: error: `LPUNKNOWN' has not been declared
C:/Arquivos de programas/CodeBlocks/include/objidl.h:595: error: `IUnknown' has not been declared
C:/Arquivos de programas/CodeBlocks/include/objidl.h:596: error: `IUnknown' has not been declared
C:/Arquivos de programas/CodeBlocks/include/objidl.h:668: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:699: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:718: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:732: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:768: error: expected class-name before '{' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:783: error: expected class-name before '{' token
Process terminated with status 1 (0 minutes, 4 seconds)
It happens when CLevel.h at line 34 includes CConnect.h, which on line 6 includes winsock2.h which on line 22 includes windows.h which on line 111 includes ole2.h which on line 9 includes objbase.h which on line 73 includes unknwn.h

Any idea? I'm completely lost

Thanks
Title: Re: Weird error in unknwn.h and objidl.h error after including a certain file
Post by: MortenMacFly on June 05, 2007, 03:45:42 pm
Quote
Project   : Underio
C:/Arquivos de programas/CodeBlocks/include/unknwn.h:31: error: expected init-declarator before '*' token
C:/Arquivos de programas/CodeBlocks/include/objidl.h:783: error: expected class-name before '{' token
This headers are *not* part of the Code::Blocks SDK. Thus it's not Code::Blocks related.
With regards, Morten.
Title: Re: Weird error in unknwn.h and objidl.h error after including a certain file
Post by: TDragon on June 05, 2007, 03:51:37 pm
Clash: What Morten means is that, although the MinGW/GCC compiler is bundled with Code::Blocks, the Code::Blocks developers didn't create it and generally don't provide support for it -- only for things specifically related to the Code::Blocks IDE.

I, personally, don't have any idea why that error is happening. You might try asking first at the Irrlicht forums -- make sure they know you're using MinGW -- and then, only if the Irrlicht people can't help you, the mingw-users mailing list (http://www.mingw.org/lists.shtml).
Title: Re: Weird error in unknwn.h and objidl.h error after including a certain file
Post by: Clash on June 05, 2007, 04:54:58 pm
Thanks guys, you are all correct, I was dumb to post here. Why the hell did I thought you guys made those libraries?

Anyways, while posting here I noticed that Irrlicht also had a class called IUnknown, so I posted there and they promptly responded me what to do. Had to do with the order windows.h and irrlicht.h were included and the irr namespace.

Thanks and sorry for having disturbed you guys! :D