VS 2010 Upgrade: error C2061: syntax error : identifier 'exception'

I've imported a VC++ 6.0 project into Visual Studio 2010 and am trying to compile it.

I get this error:
error C2061: syntax error : identifier 'exception'
on this code
            try
            {
                      //
             }
            catch (exception& e)
            {
                     //
             }

I tried adding:
      #include <exception>

but got the same result.

What must I do to make this compile?

Thanks!
PMH4514Asked:
Who is Participating?
 
sarabandeCommented:
you might try std::exception.

Sara
0
 
PMH4514Author Commented:
Thank you Sara that did the trick!
0
 
sarabandeCommented:
in VC6 i assume you had namespace std as default before probably by some header.

in VS2010 (VC10) they are more strict and and could have - for example - removed 'using namespace std;' clause from precompiled header automatically.

alternatively to adding std:: prefix you might have a using clause below your include statements, for example

using namespace std; 

Open in new window


Sara
0
 
PMH4514Author Commented:
Thank you for the additional information
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.