I’m writing an application in Visual c++ 2005 express. I need to use VC++ because I have to create the GUI, but when I compile I get an ambiguous symbol error whenever I use System or FMOD::System in the code.
How can I resolve the problem?
- dr acv asked 11 years ago
No, this is not the problem. I have a namespace problem. Visual C++ has a namespace called System.
If I use
[code:2muvo3sp]using namespace System;
using namespace FMOD;
everytime the code contains a reference to System the compiler gives me an ambiguity error, because it can’t choose between FMOD::System and System.
Instead, whenever I use FMOD::System there’s no problem.
If I don’t use FMOD namespace I receive a warning telling me that FMOD_SYSTEM is an unresolved typeref and that the program could not work.
I tried to use ::System insted of System and also to create an alias for the System namespace but these solution give other different errors.
- dr acv answered 11 years ago
[quote="artscoop":3pb2w12c]Maybe you have a class named system in your System namespace, in which case you should use System::System.
You misunderstand him. The problem is that on windows if you use the "use namespace FMOD" statement you will have two namespaces named "System".
Hence the compiler will not be able to make a difference between them and see both "System" namespaces as one. Which is the reason namespaces was introduced to stop. So using the statement "using namespace FMOD" should not be used on the windows platform (and possibly XBOX?), or things might eventually break.
- zewrak answered 11 years ago
Please login first to submit.