简体   繁体   中英

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

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.

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

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. Eg the StringCchPrintf function is not nearly as safe as std::osstream .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM