Friday 6 December 2013

warning C4995: 'sprintf': name was marked as #pragma deprecated

Hello everyone,

warning C4995: 'sprintf': name was marked as #pragma deprecated

I got the set of related warning mentioned above while compiling the directshow filter project used along with std::auto_ptr(...). When I include the include file <memory> without directshow any includes(streams.h) I didn't get this warning.

After long struggle I found that these warning are coming because I didn't put the #include <memory> header file for std::auto_ptr before direct show headers(#include <streams.h>)

So after specifying the include files order properly I didn't get these warnings, so even the order of including files plays the trick here.

Hope this helps someone.

Thanks,
Raja Bose C Leo.