• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1027
  • Last Modified:

How do I define which namespace compiler should use in MFC?

My MFC project includes several modules and now I introduced another with access to WebServices. Since then I get the compiler error:
error C2872: 'CMutex' : ambiguous symbol
        could be 'c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxmt.h(105) : CMutex'
        or 'c:\program files\microsoft visual studio 8\vc\atlmfc\include\atlsync.h(77) : ATL::CMutex'
Obviously both files have CMutex class defined and it is not the same. If ATL versiun would be the one this module needs, I could probably define the namespace with ATL::CMutex. But how can I tell the compiler that it should take the first version? It has no namespace specified!?
0
igams
Asked:
igams
1 Solution
 
Jaime OlivaresCommented:
MFC classes don't belong to a namespace.
Do you have to use both ATL and MFC in the same application?
0
 
jkrCommented:
You could use

::CMutex myMutex;
0
 
igamsAuthor Commented:
Simple solutions are always the best! I should have thought of it myself! :-)
But then I got confused with namespaces...
Thanks a lot!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now