What does "use -D_SCL_SECURE_NO_WARNINGS" mean?

I'd like to also add that if you want to use

#define _SCL_SECURE_NO_WARNINGS

directly in your code, you have to place it before including headers. Or you can use

#pragma warning(disable:4996)

-D is a command line compiler flag which causes the rest of the text to be treated as if there was a #define in your code.

In solution explorer, right click the project, select "properties". The project property page will open. Expand the ">C/C++" entry in the tree on the left and select "Preprocessor" under that. The top entry in the right pane should be "Preprocessor Definitions". In that edit box, add _SCL_SECURE_NO_WARNINGS, separating it from the other entries with a ;


-D means "define a macro", in this case _SCL_SECURE_NO_WARNINGS. Which mean somewhere in the code there's a

#if defined(_SCL_SECURE_NO_WARNINGS)

line. If you want to do this from inside VS, go to the project's properties page, and under one fo the tabs there should be a spot to add new defines. There should already be some listed (like DEBUG). Add _SCL_SECURE_NO_WARNINGS there.