Blog Home  Home Feed your aggregator (RSS 2.0)  
First experience with Microsoft Technical Support - Manuel Abadia's ASP.NET stuff
 
# Friday, 20 July 2007

Last weekend I tried to compile some old C++ code that was working without problems in VS 2003. Unfortunately it didn’t work in VS 2005 and it was reporting some strange errors in the stl vector include file:


Error      1             error C2825: '_MycontTy': must be a class or namespace when followed by '::'                C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\vector        1323     
Error      2             error C2039: 'difference_type' : is not a member of '`global namespace''            C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\vector        1323     
Error      3             error C2146: syntax error : missing ',' before identifier 'difference_type'             C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\vector        1323     
Error      4             error C2065: 'difference_type' : undeclared identifier   C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\vector     1323     
Error      5             error C2955: 'std::_Ranit' : use of class template requires template argument list           C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\vector        1325     
Error      6             error C2825: '_MycontTy': must be a class or namespace when followed by '::'                C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\vector        1380     
Error      7             error C2039: 'size_type' : is not a member of '`global namespace''          C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\vector          1380     
Error      8             error C2146: syntax error : missing ';' before identifier '_Myoff'               C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\vector          1380     
Error      9             error C4430: missing type specifier - int assumed. Note: C++ does not support default-int         C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\vector              1380     
Error      10           error C2825: '_MycontTy': must be a class or namespace when followed by '::'                C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\vector        1403     
Error      11           error C2327: 'std::_Vb_iter_base<_MycontTy>::size_type' : is not a type name, static, or enumerator                C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\vector     1403     
Error      12           error C2039: 'size_type' : is not a member of '`global namespace''          C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\vector          1403     
Error      13           error C2146: syntax error : missing ';' before identifier '_My_actual_offset'       C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\vector        1403     
Error      14           error C2086: 'int std::_Vb_iter_base<_MycontTy>::size_type' : redefinition     C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\vector        1403     
Error      15           error C4430: missing type specifier - int assumed. Note: C++ does not support default-int         C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\vector              1404     
Warning              16           warning C4183: '_My_actual_offset': missing return type; assumed to be a member function returning 'int'    C:\Program Files (x86)\Microsoft Visual Studio 8\VC\include\vector     1404     

I didn’t found any reference about those errors in the web and after looking at the code I was completely puzzled about them. Also, as I haven’t used C++ in two years the code was “darker” than usual for me. I guess that I’m now a lazy C# programmer.

As my MSDN subscription has some free support incidents that I have never used I decided to try it. My experience was great. I explained my problem to a Microsoft Technical Support guy, sent my solution, and a couple of days later he found the problem.

Of course, the problem had nothing to do with std::vector. Somehow the use of std::swap<T>(T obj1, T obj2) in several places broke the compiler. The workaround suggested was to use std::swap<> instead of std::swap<int> so the type deduction mechanism in the compiler takes place avoiding a nasty VC++ 2005 bug.
As the problem was because of a bug in VC++ 2005 my number of assistance tickets is not decremented so I can keep bothering Microsoft support guys for free ;-)

I think I didn’t spent more than 30 minutes looking at the problem and I have it fixed for free thanks to their support staff. Without Microsoft support I would have spent a lot of days to find the error, or more probably, I would have stopped trying to convert the old project to VS 2005.

Thank god that their technical support has nothing to do with the activation and Vista related support.

So, if you ever run into a hard technical problem, think about calling Microsoft Support.

Friday, 20 July 2007 17:06:32 (Romance Daylight Time, UTC+02:00)  #    Comments [2]   Visual Studio  | 
Copyright © 2018 Manuel Abadia. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.