I'm trying to use DirectInput for my game based on the Irrlicht engine, but when I compile, I get an 'ambiguous symbol' error. Apparently Microsoft has some class, also called IUnknown, and it can't tell the difference between this class and Irrlichts. When I compile, I get the following error:
C:\My Program Files\Microsoft Visual Studio.NET\Vc7\PlatformSDK\Include\Unknwn.h(97): error C2872: 'IUnknown' : ambiguous symbol
could be 'C:\My Program Files\Microsoft Visual Studio.NET\Vc7\PlatformSDK\Include\Unknwn.h(48) : irr::IUnknown IUnknown'
or 'c:\Documents and Settings\Mark\My Documents\Progging\irrlicht-0.6\include\IUnknown.h(42) : irr::IUnknown'
What should I do about this? Did anyone else have similar problems?
DirectInput and Irrlicht working together?
-
Mark P Neyer
Fixed the problem. If you want to include other people's stuff, it isn't a good idea to just add 'using namespace irr' to your code. I just made a file with the following text in it:
#include <irrlicht.h>
using namespace irr::core;
using namespace irr::video;
using namespace irr::scene;
using namespace irr::io;
using irr::c8;
using irr::u32;
using irr::IrrlichtDevice;
using irr::s32;
using irr::createDevice;
and any time I had a file that wanted to use anything from the irr engine, I just had it include that file. As long as you dont do anything like 'using namespace irr' you shouldn't get this error.
#include <irrlicht.h>
using namespace irr::core;
using namespace irr::video;
using namespace irr::scene;
using namespace irr::io;
using irr::c8;
using irr::u32;
using irr::IrrlichtDevice;
using irr::s32;
using irr::createDevice;
and any time I had a file that wanted to use anything from the irr engine, I just had it include that file. As long as you dont do anything like 'using namespace irr' you shouldn't get this error.
-
Mark P Neyer
Fixed the problem. If you want to include other people's stuff, it isn't a good idea to just add 'using namespace irr' to your code. I just made a file with the following text in it:
#include <irrlicht.h>
using namespace irr::core;
using namespace irr::video;
using namespace irr::scene;
using namespace irr::io;
using irr::c8;
using irr::u32;
using irr::IrrlichtDevice;
using irr::s32;
using irr::createDevice;
and any time I had a file that wanted to use anything from the irr engine, I just had it include that file. As long as you dont do anything like 'using namespace irr' you shouldn't get this error.
#include <irrlicht.h>
using namespace irr::core;
using namespace irr::video;
using namespace irr::scene;
using namespace irr::io;
using irr::c8;
using irr::u32;
using irr::IrrlichtDevice;
using irr::s32;
using irr::createDevice;
and any time I had a file that wanted to use anything from the irr engine, I just had it include that file. As long as you dont do anything like 'using namespace irr' you shouldn't get this error.