I wrote a program in C# for my discrete mathematics class and it worked absolutely fine. My teacher asked me to submit the code in c++ so she can run it on her mac and so I created a new project and typed the code in. After changing everything required (basic syntax editing and changing Lists to vectors) I tried compiling my program and got these errors. I am using visual studio 2010.
Error 6 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility 373 1 hw9_2_cpp
Error 8 error C2868: 'std::iterator_traits<_Iter>::iterator_category' : illegal syntax for using-declaration; expected qualified-name c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility 373 1 hw9_2_cpp
Error 7 error C2602: 'std::iterator_traits<_Iter>::iterator_category' is not a member of a base class of 'std::iterator_traits<_Iter>' c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility 373 1 hw9_2_cpp
Error 5 error C2146: syntax error : missing ';' before identifier 'iterator_category' c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility 373 1 hw9_2_cpp
Error 4 error C2039: 'iterator_category' : is not a member of 'std::vector<_Ty,_Ax>' c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility 373 1 hw9_2_cpp
I haven't posted the source code yet, because my program compiles successfully using g++ on a linux machine. I get no warnings and errors using that and the execution of program is fine too.
I have no idea why I am getting this error. Could it possible be that I messed up that xutility file?
Do you suggest replacing that file (I really don't want to get into a version mismatch and get screwed up!) ?
Any help/suggestions are highly appreciated.
Thank you,
-T2
P.S.: I came back here after an year and now it reads "Contribute New Article" instead of posting a question or something. I couldn't find anything like that and I think it's just that way. I was just wondering as it's not really an article but a question.