Convert C++ from VisC++ 6 to VS 2008 [modified]
-
Folks, I have a VERY OLD legacy app that I'm trying to compile under VS 2008 (I am NOT an MFC developer at all). I am running into build errors on things like:
template <> void AFXAPI ConstructElements <SubjectUsage> (SubjectUsage * pSubName, int nCount)
NOTE: Edited this to correct the line ERRORS for this is: C2143 Syntax error: missing ";" before "<" C2182: "ConstructElements: illegal use of type 'void' C2988: unrecognizable template declaration/definition I know NOTHING about the AFXAPI, but the file does have an <code>#include <afxtempl.h> </code> Any help greatly appreciated, and in general, any words of wisdom from moving from VC++6 to VS2008?modified on Wednesday, May 20, 2009 2:06 PM
-
Folks, I have a VERY OLD legacy app that I'm trying to compile under VS 2008 (I am NOT an MFC developer at all). I am running into build errors on things like:
template <> void AFXAPI ConstructElements <SubjectUsage> (SubjectUsage * pSubName, int nCount)
NOTE: Edited this to correct the line ERRORS for this is: C2143 Syntax error: missing ";" before "<" C2182: "ConstructElements: illegal use of type 'void' C2988: unrecognizable template declaration/definition I know NOTHING about the AFXAPI, but the file does have an <code>#include <afxtempl.h> </code> Any help greatly appreciated, and in general, any words of wisdom from moving from VC++6 to VS2008?modified on Wednesday, May 20, 2009 2:06 PM
gartnerj wrote:
template <> void AFXAPI ConstructElements (SubjectUsage * pSubName, int nCount)
There appears to be something missing from this statement. Try clicking the "Do not interpret HTML..." checkbox, and use the Verify button.
gartnerj wrote:
C2143 Syntax error: missing ";" before "<"
It looks as though the compiler does not know what
SubjectUsage
is."Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
-
Folks, I have a VERY OLD legacy app that I'm trying to compile under VS 2008 (I am NOT an MFC developer at all). I am running into build errors on things like:
template <> void AFXAPI ConstructElements <SubjectUsage> (SubjectUsage * pSubName, int nCount)
NOTE: Edited this to correct the line ERRORS for this is: C2143 Syntax error: missing ";" before "<" C2182: "ConstructElements: illegal use of type 'void' C2988: unrecognizable template declaration/definition I know NOTHING about the AFXAPI, but the file does have an <code>#include <afxtempl.h> </code> Any help greatly appreciated, and in general, any words of wisdom from moving from VC++6 to VS2008?modified on Wednesday, May 20, 2009 2:06 PM
-
gartnerj wrote:
Any help greatly appreciated, and in general, any words of wisdom from moving from VC++6 to VS2008?
How to: Upgrade Projects from Previous Versions of Visual C++[^]
-
gartnerj wrote:
template <> void AFXAPI ConstructElements (SubjectUsage * pSubName, int nCount)
There appears to be something missing from this statement. Try clicking the "Do not interpret HTML..." checkbox, and use the Verify button.
gartnerj wrote:
C2143 Syntax error: missing ";" before "<"
It looks as though the compiler does not know what
SubjectUsage
is."Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
Well, I didn't include all of the code, but the SubjectUsage class is defined right above this line in the file, so that shouldn't be an issue. This code DOES compile in Visual C++ 6.0. I'm sure there must be differences with C++ and with the MFC supplied with VS 2008 that is causing this -- not sure if there are any project switches to set for compatibility? Also, the CORRECT statement that has the errors is:
template <> void AFXAPI ConstructElement <SubjectUsage> (SubjectUsage * pSubUsage, int nCount)
Sorry about that! -
Folks, I have a VERY OLD legacy app that I'm trying to compile under VS 2008 (I am NOT an MFC developer at all). I am running into build errors on things like:
template <> void AFXAPI ConstructElements <SubjectUsage> (SubjectUsage * pSubName, int nCount)
NOTE: Edited this to correct the line ERRORS for this is: C2143 Syntax error: missing ";" before "<" C2182: "ConstructElements: illegal use of type 'void' C2988: unrecognizable template declaration/definition I know NOTHING about the AFXAPI, but the file does have an <code>#include <afxtempl.h> </code> Any help greatly appreciated, and in general, any words of wisdom from moving from VC++6 to VS2008?modified on Wednesday, May 20, 2009 2:06 PM
-
gartnerj wrote:
but not a lot of info on using old MFC with VS 2008.
Yes but old MFC is just C++. Stuart has provided the pinpoint documentation for you so you can move on. If you find other problems they will be similar because VC6 did not fully implement the C++ Standards. I don't believe 2008 does either but it implements much more which can produce compiler errors in old code due to the compiler enforcing more standards. Each version of VC since 6 has been more compliant so as in this example the documentation might be version specific since it was changed in a specific version.
-
-
gartnerj wrote:
but not a lot of info on using old MFC with VS 2008.
Yes but old MFC is just C++. Stuart has provided the pinpoint documentation for you so you can move on. If you find other problems they will be similar because VC6 did not fully implement the C++ Standards. I don't believe 2008 does either but it implements much more which can produce compiler errors in old code due to the compiler enforcing more standards. Each version of VC since 6 has been more compliant so as in this example the documentation might be version specific since it was changed in a specific version.