Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

There is no strsafe.h in MinGW? What to use instead?

Tags:

c++

mingw

strsafe

Compiling first snippet from here : http://msdn.microsoft.com/en-us/library/ms682499(VS.85).aspx

gives: d:\!TC\cpp\control.cpp:4:21: fatal error: strsafe.h: No such file or directory compilation terminated.

like image 816
rsk82 Avatar asked Jun 10 '12 17:06

rsk82


2 Answers

Download this: it's a header file. Copy it to the path "/mingw/include" folder and it will work thats all

like image 77
kum_nitdgp Avatar answered Nov 04 '22 14:11

kum_nitdgp


You're using C++, per your tags. The "strsafe" functions are an attempt to make C a tiny bit safer. But C++ is already far safer. E.g the StringCchPrintf function is not nearly as safe as std::osstream.

like image 26
MSalters Avatar answered Nov 04 '22 12:11

MSalters