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

Name conflicts with CriticalSection

When I include the ATL support to my existing (C++ Win32) application I will get this compiler error:

error C2872: 'CCriticalSection' : ambiguous symbol
        could be 'c:\Program\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\afxmt.h(152) : CCriticalSection'
        or       'c:\Program\Microsoft Visual Studio .NET 2003\Vc7\atlmfc\include\atlsync.h(27) : ATL::CCriticalSection'

The framework include ATL to support Web Service call.

Running: VC7 C++
Platform: Windows XP SP2 / Server 2003
0
TYB
Asked:
TYB
  • 2
1 Solution
 
ddunleaCommented:
Hi TYB,

Try "using namespace ATL;"
0
 
TYBAuthor Commented:
Can't affect the ATL call.

The framework is making this when creating the stub code to access the web service.
0
 
itsmeandnobodyelseCommented:
Analyze both header files. The class declaration of CCriticalSection should be protected by a macro at least by one of these ATL headers. Most likely you have to change the order of your includes somehow to get it compiled.

Regards, Alex
 
0
 
TYBAuthor Commented:
Tnx a lot for the answer itsmeandnobodyelse.... it helped us out.

Now we can compile the application successfully ..and it´s working properly too : )
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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