none
Warnings C4995

    Question

  • Hello,

    Can someone help me to correct those warnings.

    Code Snippet

     warning C4995: 'gets': name was marked as #pragma deprecated
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include\cstdio(37) : warning C4995: 'sprintf': name was marked as #pragma deprecated
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include\cstdio(40) : warning C4995: 'vsprintf': name was marked as #pragma deprecated
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include\cstring(20) : warning C4995: 'strcat': name was marked as #pragma deprecated
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include\cstring(21) : warning C4995: 'strcpy': name was marked as #pragma deprecated
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include\cwchar(34) : warning C4995: 'swprintf': name was marked as #pragma deprecated
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include\cwchar(35) : warning C4995: 'vswprintf': name was marked as #pragma deprecated
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include\cwchar(37) : warning C4995: 'wcscat': name was marked as #pragma deprecated
    1>C:\Program Files\Microsoft Visual Studio 8\VC\include\cwchar(39) : warning C4995: 'wcscpy': name was marked as #pragma deprecated



    I tried to include
    _CRT_NONSTDC_NO_DEPRECATE
    _CRT_SECURE_NO_DEPRECATE

    And I also tried to add it into the compiler propreties:
    go to "Configuration Properties" --> "C/C++" --> "Command Line"
    3. In "Additional options" textbox enter the folowing text
        /D "_CRT_SECURE_NO_DEPRECATE"

    But without any succes!
    I am wondering how can it looks for this

    "C:\Program Files\Microsoft Visual Studio 8\VC\include\" directory since I am not telling this path into the VC++ Directory settings.
    I use the new SDK:
    "C:\Program Files\Microsoft SDKs\Windows\v6.0\Include"

    Does anyone know how to fix those errors.

    Cheers
    Tuesday, May 29, 2007 9:19 AM

Answers

  • Try adding 4995 to the specifically ignored warning codes in your project properties => configuration properties => c/c++ => advanced section.
    Tuesday, May 29, 2007 9:46 AM
    Moderator

All replies

  • Try adding 4995 to the specifically ignored warning codes in your project properties => configuration properties => c/c++ => advanced section.
    Tuesday, May 29, 2007 9:46 AM
    Moderator
  • I've found that  _CRT_NON_CONFORMING_SWPRINTFS is required too in some cases although not been able to understand the reason fully.
    Monday, August 25, 2008 4:31 PM
  • Just add the directive #include <iostream> before the SDK header <Dshow.h>! 
    • Proposed as answer by Mister-Zorg Thursday, September 18, 2008 12:08 PM
    Thursday, September 18, 2008 12:04 PM
  • Careful with adding #include <iosteram>, it could lead to linker issue on certain circumstances: (when you are using Static version of runtime CR as MT (Multithread instead of Multithread DLL).

    http://support.microsoft.com/default.aspx?scid=kb;en-us;148652

     


    C--s
    Friday, November 19, 2010 1:24 AM