Jump to content
  • Advertisement
Sign in to follow this  
irreversible

Error 10 error C2011: 'IUnknown' : 'struct' type redefinition

This topic is 3922 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Why am I pointing this out? Because this error only occurs if the name of the class is IUnknown. I'm not using COM or DX (the most non-application headers included are windows.h and fstream). Using MSVC 8. If anyone knows why this might be happening, please share. PS - renaming the class fixes the problem. But I want to name it IUnknown, dammit. Cheers

Share this post


Link to post
Share on other sites
Advertisement
The answer is clearly as the error message

IUnknown is just one of the existing class



//*********** This is what I found on MSDN *************//
IUnknown is the base interface of every other COM interface. IUnknown defines three methods: QueryInterface, AddRef, and Release. QueryInterface allows an interface user to ask the object for a pointer to another of its interfaces. AddRef and Release implement reference counting on the interface.




This mean you must change your class name.

Share this post


Link to post
Share on other sites
Hmm - why would COM be included in windows.h ... Oh well. (and yes - I'm familiar with COM objects and interfacing methods - I just didn't expect them to be so readily available, is all)

Anyways - namespacing is a nice simple solution - odd that my brain skipped over that :P

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!