none
Converting project to VS 2010, tons of errors after including <vector>

    Question

  • I have converted a program to use VS2010, and am receiving a ton of errors.  I pinpointed them somewhat.  If I remove my #include <vector> then I only have vector related errors, but the rest succeeds:

    1>c:\jebenson-download\u2\3000\drivers\location\NMEAParser.h(121): error C2039: 'vector' : is not a member of 'std'

    1>c:\jebenson-download\u2\3000\drivers\location\NMEAParser.h(121): error C2061: syntax error : identifier 'vector'

    1>c:\jebenson-download\u2\3000\drivers\location\NMEAParser.h(128): error C2039: 'vector' : is not a member of 'std'

    1>c:\jebenson-download\u2\3000\drivers\location\NMEAParser.h(128): error C2061: syntax error : identifier 'vector'

    1>c:\jebenson-download\u2\3000\drivers\location\NMEAParser.h(248): error C2039: 'vector' : is not a member of 'std'

    1>c:\jebenson-download\u2\3000\drivers\location\NMEAParser.h(248): error C2143: syntax error : missing ';' before '<'

    1>c:\jebenson-download\u2\3000\drivers\location\NMEAParser.h(248): error C2238: unexpected token(s) preceding ';'

    1>c:\jebenson-download\u2\3000\drivers\location\NMEAParser.h(254): error C2039: 'vector' : is not a member of 'std'

    1>c:\jebenson-download\u2\3000\drivers\location\NMEAParser.h(254): error C2143: syntax error : missing ';' before '<'

    1>c:\jebenson-download\u2\3000\drivers\location\NMEAParser.h(254): error C2238: unexpected token(s) preceding ';'

    1>c:\jebenson-download\u2\3000\drivers\location\SensorDdi.h(121): error C2039: 'vector' : is not a member of 'std'

    1>c:\jebenson-download\u2\3000\drivers\location\SensorDdi.h(121): error C2061: syntax error : identifier 'vector'

     

    But, as soon as I add the #include <vector> I get a bunch of errors in ymath.h, limits, and iosfwd:

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(19): error C2146: syntax error : missing ';' before identifier 'streamoff'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(28): error C2143: syntax error : missing ';' before 'const'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(28): error C2146: syntax error : missing ';' before identifier '_BADOFF'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(28): error C2373: 'std::streamoff' : redefinition; different type modifiers

    1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(19) : see declaration of 'std::streamoff'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(38): error C2061: syntax error : identifier 'streamoff'

    1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(117) : see reference to class template instantiation 'std::fpos<_Statetype>' being compiled

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(63): error C2833: 'operator streamoff' is not a recognized operator or type

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(63): error C2059: syntax error : 'newline'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(64): error C2334: unexpected token(s) preceding '{'; skipping apparent function body

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(68): error C2143: syntax error : missing ';' before '-'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(73): error C2061: syntax error : identifier 'streamoff'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(74): error C2805: binary 'operator +=' has too few parameters

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(74): error C2333: 'std::fpos<_Statetype>::operator +=' : error in function declaration; skipping function body

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(79): error C2061: syntax error : identifier 'streamoff'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(80): error C2805: binary 'operator -=' has too few parameters

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(80): error C2333: 'std::fpos<_Statetype>::operator -=' : error in function declaration; skipping function body

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(85): error C2061: syntax error : identifier 'streamoff'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(91): error C2061: syntax error : identifier 'streamoff'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(102): error C2061: syntax error : identifier 'streamoff'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(103): error C2805: binary 'operator ==' has too few parameters

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(103): error C2333: 'std::fpos<_Statetype>::operator ==' : error in function declaration; skipping function body

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(114): error C2146: syntax error : missing ';' before identifier '_Myoff'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(140): error C2146: syntax error : missing ';' before identifier 'off_type'

    1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(253) : see reference to class template instantiation 'std::_Char_traits<_Elem,_Int_type>' being compiled

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(286): error C2146: syntax error : missing ';' before identifier 'off_type'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(292): error C2065: '_CSTD' : undeclared identifier

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(292): error C2146: syntax error : missing ')' before identifier 'wmemcmp'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(292): error C2059: syntax error : ')'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(297): error C2065: '_CSTD' : undeclared identifier

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(297): error C2146: syntax error : missing ')' before identifier 'wcslen'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(297): error C2059: syntax error : ')'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(303): error C2065: '_CSTD' : undeclared identifier

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(303): error C2146: syntax error : missing ')' before identifier 'wmemcpy'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(303): error C2059: syntax error : ')'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(310): error C3861: '_CRT_SECURE_WMEMCPY': identifier not found

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(317): error C2065: '_CSTD' : undeclared identifier

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(317): error C2146: syntax error : missing ')' before identifier 'wmemchr'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(317): error C2059: syntax error : ')'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(323): error C2065: '_CSTD' : undeclared identifier

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(323): error C2146: syntax error : missing ')' before identifier 'wmemmove'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(323): error C2059: syntax error : ')'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(328): error C2065: '_CSTD' : undeclared identifier

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(328): error C2146: syntax error : missing ')' before identifier 'wmemset'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(328): error C2059: syntax error : ')'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(480): error C2146: syntax error : missing ';' before identifier 'off_type'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(486): error C2065: '_CSTD' : undeclared identifier

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(486): error C2146: syntax error : missing ')' before identifier 'memcmp'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(486): error C2059: syntax error : ')'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(491): error C2065: '_CSTD' : undeclared identifier

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(491): error C2146: syntax error : missing ')' before identifier 'strlen'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(491): error C2059: syntax error : ')'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(497): error C2065: '_CSTD' : undeclared identifier

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(497): error C2146: syntax error : missing ')' before identifier 'memcpy'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(497): error C2059: syntax error : ')'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(504): error C3861: '_CRT_SECURE_MEMCPY': identifier not found

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(511): error C2065: '_CSTD' : undeclared identifier

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(511): error C2146: syntax error : missing ')' before identifier 'memchr'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(511): error C2059: syntax error : ')'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(517): error C2065: '_CSTD' : undeclared identifier

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(517): error C2146: syntax error : missing ')' before identifier 'memmove'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(517): error C2059: syntax error : ')'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(522): error C2065: '_CSTD' : undeclared identifier

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(522): error C2146: syntax error : missing ')' before identifier 'memset'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\iosfwd(522): error C2059: syntax error : ')'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(9): error C2144: syntax error : 'int' should be preceded by ';'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(38): error C2146: syntax error : missing ';' before identifier '_Feraise'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(38): error C2182: '__CLRCALL_PURE_OR_CDECL' : illegal use of type 'void'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(41): error C2146: syntax error : missing ';' before identifier '_Cosh'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(41): error C2371: '__CLRCALL_PURE_OR_CDECL' : redefinition; different basic types

    1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(38) : see declaration of '__CLRCALL_PURE_OR_CDECL'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(42): error C2146: syntax error : missing ';' before identifier '_Dtest'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(42): error C2371: '__CLRCALL_PURE_OR_CDECL' : redefinition; different basic types

    1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(38) : see declaration of '__CLRCALL_PURE_OR_CDECL'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(43): error C2146: syntax error : missing ';' before identifier '_Exp'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(43): error C2371: '__CLRCALL_PURE_OR_CDECL' : redefinition; different basic types

    1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(38) : see declaration of '__CLRCALL_PURE_OR_CDECL'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(44): error C2146: syntax error : missing ';' before identifier '_Sinh'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(44): error C2371: '__CLRCALL_PURE_OR_CDECL' : redefinition; different basic types

    1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(38) : see declaration of '__CLRCALL_PURE_OR_CDECL'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(49): error C2146: syntax error : missing ';' before identifier '_FCosh'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(49): error C2371: '__CLRCALL_PURE_OR_CDECL' : redefinition; different basic types

    1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(38) : see declaration of '__CLRCALL_PURE_OR_CDECL'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(50): error C2146: syntax error : missing ';' before identifier '_FDtest'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(50): error C2371: '__CLRCALL_PURE_OR_CDECL' : redefinition; different basic types

    1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(38) : see declaration of '__CLRCALL_PURE_OR_CDECL'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(51): error C2146: syntax error : missing ';' before identifier '_FExp'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(51): error C2371: '__CLRCALL_PURE_OR_CDECL' : redefinition; different basic types

    1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(38) : see declaration of '__CLRCALL_PURE_OR_CDECL'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(52): error C2146: syntax error : missing ';' before identifier '_FSinh'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(52): error C2371: '__CLRCALL_PURE_OR_CDECL' : redefinition; different basic types

    1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(38) : see declaration of '__CLRCALL_PURE_OR_CDECL'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(56): error C2146: syntax error : missing ';' before identifier '_LCosh'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(56): error C2371: '__CLRCALL_PURE_OR_CDECL' : redefinition; different basic types

    1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(38) : see declaration of '__CLRCALL_PURE_OR_CDECL'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(57): error C2146: syntax error : missing ';' before identifier '_LDtest'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(57): error C2371: '__CLRCALL_PURE_OR_CDECL' : redefinition; different basic types

    1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(38) : see declaration of '__CLRCALL_PURE_OR_CDECL'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(58): error C2146: syntax error : missing ';' before identifier '_LExp'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(58): error C2371: '__CLRCALL_PURE_OR_CDECL' : redefinition; different basic types

    1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(38) : see declaration of '__CLRCALL_PURE_OR_CDECL'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(59): error C2146: syntax error : missing ';' before identifier '_LSinh'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(59): error C2371: '__CLRCALL_PURE_OR_CDECL' : redefinition; different basic types

    1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\ymath.h(38) : see declaration of '__CLRCALL_PURE_OR_CDECL'

    1>C:\Program Files (x86)\Windows Kits\8.0\inc\crt\math.h(29): error C2144: syntax error : 'int' should be preceded by ';'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits(1190): error C2065: '_CSTD' : undeclared identifier

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits(1190): error C2146: syntax error : missing ')' before identifier '_FDenorm'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits(1190): error C2059: syntax error : ')'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits(1195): error C2065: '_CSTD' : undeclared identifier

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits(1195): error C2146: syntax error : missing ')' before identifier '_FInf'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits(1195): error C2059: syntax error : ')'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits(1200): error C2065: '_CSTD' : undeclared identifier

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits(1200): error C2146: syntax error : missing ')' before identifier '_FNan'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits(1200): error C2059: syntax error : ')'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits(1205): error C2065: '_CSTD' : undeclared identifier

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits(1205): error C2146: syntax error : missing ')' before identifier '_FSnan'

    1>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\limits(1205): fatal error C1003: error count exceeds 100; stopping compilation

     

    Obviously I know I should not be changing these include files, so hoping to get some assistance figuring out if there is something else I need to add to my project.

    Thanks


    jessica
    • Moved by eryang Tuesday, March 22, 2011 1:51 AM (From:Visual Studio Debugger)
    Monday, March 21, 2011 9:17 PM

All replies

  • I move this thread to VC++ forum for better support.
    Eric Yang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, March 22, 2011 1:51 AM
  • Hello,

    For the break changes of VC++ 2010, The <iterator> header is no longer included automatically by many other header files. Instead, include that header explicitly if you require support for the standalone iterators defined in the <interator> header. Please double check if it is issue on your side.

    If not, to troubleshoot this issue, we really need the source code and the detailed steps to reproduce the problem, so that we can investigate the issue locally. It is not necessary that you send out the whole of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business details from it.

     

    Yi


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, March 25, 2011 7:01 AM
  • Don't know if this will help you, but I had similar problem.

    In my case a lot of redefinition related errors were generated and I actually solved it on a way that

    I've added the following includings on top of my stdafx.h (order is important)

     

    #include <vector>

    #include <emmintrin.h>

    #include <windows.h>

     

    Obviously the important checks are added in windows.h trough #ifdef statement.

    Anyway, hope this helps.


    Wednesday, April 20, 2011 11:38 AM