-1

I have been tasked with disabling warnings in external headers "##include" and i have read a very useful tutorial named "Broken Warnings Theory" however the tutorial leaves out how to use supplied examples, so my question is:

Where in Visual Studio do i apply the following syntax? I assume it in the project properties somewhere but i have been unable to find any obvious place i should be applying it too.

cl.exe /experimental:external /external:I some_lib_dir /external:W0 /W4 my_prog.cpp

Broken warnings theory

Edwin Martin
  • 319
  • 3
  • 15
  • I would try C++/Command Line/Additional Options. – john Sep 10 '20 at 19:03
  • You mentioned `#import` instead of `#include`? – drescherjm Sep 10 '20 at 19:11
  • Consider also surrounding the relevant #include(s) with suitable `#pragma warning` statements, see: https://learn.microsoft.com/en-us/cpp/preprocessor/warning?view=vs-2019 – Paul Sanders Sep 10 '20 at 19:32
  • In the screenshot from [this question](https://stackoverflow.com/questions/58900260/how-can-i-enable-compiler-warnings-in-visual-studio-2019) you see the dialog to set various compiler parameters. I believe what you're looking for is the the _Command Line_ section in the end of the opened tree view. I cannot prove myself, because I don't have a VS installaiton at hand ATM. – πάντα ῥεῖ Sep 10 '20 at 19:40
  • @Paul It looks like the OP already had found what they want, but just miss to see where to add these cli parameters in the VS configuation. – πάντα ῥεῖ Sep 10 '20 at 19:42

1 Answers1

0

I think that you could open win+R->CMD and input cl. Then you could apply the syntax.

enter image description here

Also, you may need to set the environment variables. Add C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x86 and C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x86\cl.exe in System varibles->Path.

Barrnet Chou
  • 1,738
  • 1
  • 4
  • 7