Home Dashboard Directory Help
Search

Compile error in Visual Studio 2010 SP1 when using the "lint" preprocessor definition. by cbrass


Status: 

Closed
 as Fixed Help for as Fixed


1
0
Sign in
to vote
Type: Bug
ID: 683598
Opened: 8/9/2011 2:07:09 PM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

We have encountered a compile error in Visual Studio 2010 SP1 when using the "lint" preprocessor definition.

We have a native C++ project which defines "lint" as one of our preprocessor defines. The project also uses MFC. When we try to compile our project we encounter the following error:

1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxtempl.h(141): error C2248: 'CDumpContext::operator =' : cannot access protected member declared in class 'CDumpContext'
1>         C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afx.h(1777) : see declaration of 'CDumpContext::operator ='
1>         C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afx.h(1711) : see declaration of 'CDumpContext'
1>         c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxtempl.h(1214) : see reference to function template instantiation 'void DumpElements<TYPE>(CDumpContext &,const TYPE *,INT_PTR)' being compiled
1>         with
1>         [
1>             TYPE=CAnimationGroup *
1>         ]
1>         c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxtempl.h(1202) : while compiling class template member function 'void CList<TYPE,ARG_TYPE>::Dump(CDumpContext &) const'
1>         with
1>         [
1>             TYPE=CAnimationGroup *,
1>             ARG_TYPE=CAnimationGroup *
1>         ]
1>         c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxanimationcontroller.h(2141) : see reference to class template instantiation 'CList<TYPE,ARG_TYPE>' being compiled
1>         with
1>         [
1>             TYPE=CAnimationGroup *,
1>             ARG_TYPE=CAnimationGroup *
1>         ]
1>c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxtempl.h(141): error C2248: 'CDumpContext::operator =' : cannot access protected member declared in class 'CDumpContext'
1>         C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afx.h(1777) : see declaration of 'CDumpContext::operator ='
1>         C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\afx.h(1711) : see declaration of 'CDumpContext'
1>         c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxtempl.h(657) : see reference to function template instantiation 'void DumpElements<TYPE>(CDumpContext &,const TYPE *,INT_PTR)' being compiled
1>         with
1>         [
1>             TYPE=D2D1_GRADIENT_STOP
1>         ]
1>         c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxtempl.h(650) : while compiling class template member function 'void CArray<TYPE,ARG_TYPE>::Dump(CDumpContext &) const'
1>         with
1>         [
1>             TYPE=D2D1_GRADIENT_STOP,
1>             ARG_TYPE=D2D1_GRADIENT_STOP
1>         ]
1>         c:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\afxrendertarget.h(1027) : see reference to class template instantiation 'CArray<TYPE,ARG_TYPE>' being compiled
1>         with
1>         [
1>             TYPE=D2D1_GRADIENT_STOP,
1>             ARG_TYPE=D2D1_GRADIENT_STOP
1>         ]

We did not have this problem prior to installing SP1. It appears that some of the new MFC classes like CAnimationGroup prevent compilation with the "lint" preprocessor define.

To workaround the problem, we've removed the "lint" preprocessor define.
Details
Sign in to post a comment.
Posted by Microsoft on 8/11/2011 at 1:11 PM
Hello,

Thanks for the report. This issue has been fixed in MFC for the next major release of Visual Studio. The problem is due to the different definition of UNREFERENCED_PARAMETER (in winnt.h) when lint is #defined.

Pat Brenner
Visual C++ Libraries Development
Posted by MS-Moderator08 [Feedback Moderator] on 8/10/2011 at 1:01 AM
Thank you for submitting feedback on Visual Studio 2010 and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by MS-Moderator01 on 8/9/2011 at 7:24 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.