Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3046

Where to put #define _CRT_SECURE_NO_WARNINGS?

$
0
0
I routinely compile with #define _CRT_SECURE_NO_WARNINGS.

When I put before the first #include in my main (and only) module, I get a compile-time warning or error. (I don't rememeber which.)

But it works fine if I put that directive after the #pragma once directive in the stdafx.h file.

The two approaches should be identical insofar as the order in which the compiler sees the lines of code.

Must I really put #define _CRT_SECURE_NO_WARNINGS into stdafx.h (or the first #include'd file, which is stdafx.h for me)?

Or am I doing something inexplicably incorrect when I put #define _CRT_SECURE_NO_WARNINGS into my main (and only) module?

Viewing all articles
Browse latest Browse all 3046

Trending Articles