DirectX IUknown ambiguous symbol error

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
funcdoobiest
Posts: 48
Joined: Thu Jun 15, 2006 6:35 pm

DirectX IUknown ambiguous symbol error

Post by funcdoobiest »

I am trying to use some directshow stuff in my game and so i have included the directx headers. i am getting masses of these ambiguos symbol errors

c:\program files\microsoft visual studio 8\vc\platformsdk\include\ocidl.h(393) : error C2872: 'IUnknown' : ambiguous symbol
could be 'c:\program files\microsoft visual studio 8\vc\platformsdk\include\unknwn.h(110) : IUnknown'
or 'c:\irrlicht-1.0\include\iunknown.h(42) : irr::IUnknown'

I realise that it is the IUknown base classes defined by both DX and Irrlicht clashing, my question is how do i stop it happening!?

I assume this could be resolved throught the use of the namespaces but I haven't found a way of doing so yet. I have had similar problems before which have usually been solved by a reordering of include directories or headers, so i don't know if the following info is any use?

this is the includes and using directives at the top of the file causeing the problem:

#include <dshow.h>
#include <mmstream.h>
#include <amstream.h>
#include <ddstream.h>
#include <irrlicht.h>

using namespace irr;

my include and library directories are in the following order in the properties:

DX
OGL
Irrlicht
SDL

Any suggestions would really be appreciated.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Either include windows.h explicitly with defining WINDOWS_LEAN_AND_MEAN prior to that. Or change the include order (I think it works when including irrlicht first, but search for that on the forum).
funcdoobiest
Posts: 48
Joined: Thu Jun 15, 2006 6:35 pm

Post by funcdoobiest »

Thanks hybrid, i had given up on the reordering of includes as it didn't seem to work but I had another go when I realised I had rather lazily being ignoring the file the errors were being genereated from, it wasn't in any of the files I had assumed but in my main.cpp.

It seemed to be caused by including my header after other ones that, except for Irrlicht.h, only include FMod files.

So not 100% sure what was causing it specifically but thanks again.
Post Reply