CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Threaded View

  1. #1
    Join Date
    Dec 2012

    Where to put #define _CRT_SECURE_NO_WARNINGS?

    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?
    Last edited by joeu2004; December 23rd, 2012 at 01:52 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)