Understanding compiler options differences in visual studio 2010 and strict C++ compliance -


I am grading some homework C ++ code and a student has a non-standard manufacturer for vector vectors Used:

  vector & lt; Vector & lt; Double & gt; & Gt; A (rows, columns);   

Where rows and columns are the signed integers, the way we read it in class

  vector & lt; vector & lt; Double & gt; & Gt; A (rows, vector and lieutenance; double & gt; (column));  

I use a batch file to compile the code of all students with the command line I am

  CL / O2 / EHSC / TP & lt; Filename & gt;   

And this command threw this error on the student line described above:

  Error C2664: 'std :: vector & lt; Std :: vector & lt; Double, std :: communicator & lt; _Ty & gt; & Gt ;, std :: communicator & lt; Std :: vector & lt; _Ty, std :: communicator & lt; _Ty & gt; & Gt; & Gt; & Gt; :: Vector (std :: initializer_list & lt; std :: vector & lt; _Ty, std :: allocator & lt; _Ty & gt; const std :: allocator & lt; std :: vector & lt; _Ty, std :: allocation> <> and & gt; unsigned int 'to 2' const std :: vector & lt; Double, std :: allocator & lt; _Ty & gt; & Gt; & Amp; '[_Ty = double] Due to:' unsigned int 'from' const std :: vector & lt; Double, std :: allocator & lt; _Ty & gt; & Gt; For class [_Ty = double] constructor with 'std :: vector & lt; double, std :: allocator & lt; _Ty & gt; & Gt; ' [_Ty = double]   

has been declared 'clear', but when I prepare a project and make it with the default parameters of MSVC 2010 then this is a warning Do not put or there is no error at all.

I am trying to figure out whether the compiler option is responsible for going to IDE without warning in the IDE, and how do I turn it off.

I tried to find an answer, but I could not answer.

EDIT: I think it can be helpful for others: Thanks for the comments, now I understand that the creator category maker (# 3 in the link) above called IDE)

Here is my specific question: Both methods use the same compiler with different options (default from an IDE, second one is described above). Batch file throws an error, IDE does not need to help me identify IDE's change in command line arguments so that it throws error.

Update: I included an error message. <2 p>

Update 2: This script was running in computer with MSVC 2013 and it was the difference

When you use the command line of VS 2010 are not used.

Here VS 2010 I received the command line compilation:

  c: \ f-test> CL / O2 / EHSC / T.P. test.cpp Microsoft (R) 32-bit C / C ++ adapter compiler version 16.00.40219.01 80x86 Copyright (C) For Microsoft Corporation All rights reserved. test.cpp Microsoft (R) incremental linker version 10.00.40219.01 Copyright (c) Microsoft Corporation. All rights reserved. When I VS Compiled from the command line 2013 (I get a similar but slightly different message from the VS 2012 command line) / I: / test.obj   

I get your error message is. .

I recommend that you see the version number displayed to verify the version of the MSVC compiler using the command line.

  • VS 2010 is 16.00 xxxx (SP1 16.00.40219.01)
  • VS2012 is 17.00.xxxx (Update 4 is 17.0061030)
  • VS 2013 is 18.00.xxxx (Update 1 is 18.00.21005.1)

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -