User forums > Nightly builds

The 21 march 2006 build is out.

<< < (2/5) > >>

Acki:
Hi,
I now have a problem with unknwn.h !!!
I'm using Irrlicht (3D graphics engine).
In Irrlicht a class is defined called IUnknown.
Now in C::B there is the same class defined !!!
This doesn't matter as long as I don't use the Irrlicht's namespaces !!!
But all my projects are using the namespaces of Irrlicht...
And Irrlicht uses 6 namespaces !!!
Now I have to walk though all the source codes, delete the using namespaces and add the namespaces to the classes (1000s of lines) !!!

So is there a chance that you change back the name of IUnknown, please ?!?!?

mandrav:

--- Quote from: Acki on March 22, 2006, 03:46:04 pm ---So is there a chance that you change back the name of IUnknown, please ?!?!?

--- End quote ---

First, we don't have IUnknown anywhere in C::B sources.
Second, even if we did have IUnknown it wouldn't give you any problems with your projects.

The only IUnknown I know about, is from DirectX. So check your #includes and paths...

thomas:
You are of course joking. You must be.

First of all, your statement is not true. There is no class IUnknown defined in Code::Blocks. You can easily verify this by doing a global search on the sources, the string IUnknown does not appear anywhere (not even in a contrib plugin or a resource file).

Second, what would it matter if Code::Blocks did define such a class? That is absolutely irrelevant for any of your projects (unless you copy and paste our code into your project).

Third, namespaces have the purpose of avoiding such conflicts, and they do so quite reliably if you use them correctly. Of course, if you use one or more large libraries (such as Irrlicht) and start every source file with using every_namespace_in_existence then you deserve the trouble you get from that. This is a well-known programming sin. ;)

Acki:
Well, I don't know where unknwn.h belongs to...
But there is a pragma declared in it: #pragma GCC system_header
And there is IClassFactory defined in it: #define __IClassFactory_INTERFACE_DEFINED__
That's why I thought it belongs to C::B ?!?!?
And sorry, IUnknown isn't a class, it's a typedef: typedef IUnknown *LPUNKNOWN;
The file unknwn.h is located within c:\CodeBlocks\include
The errors occur only if I use Irrlicht and include windows.h !!!
And I havn't had this error before...

thomas:

--- Quote ---The file unknwn.h is located within c:\CodeBlocks\include
--- End quote ---
As are about 600-800 other files. None of them is necessarily related to Code::Blocks.



--- Quote ---And I havn't had this error before...
--- End quote ---
Have you used google before?

I found this within 10 seconds:
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c_dec_2004/directx/DirectXSDK/reference/IUnknown/iunknown_interface.asp


What happens here is you include headers from Irrlicht and (a possibly non-authorative version of) DirectX and what not. In addition, you make all classes that are wisely hidden inside namespaces globally visible by using using globally.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version