简体   繁体   English

MinGW中没有strsafe.h? 用什么代替?

[英]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 从这里编译第一个片段: 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. 给出: 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 将其复制到路径“/ mingw / include”文件夹,它将全部工作

You're using C++, per your tags. 您根据标签使用C ++。 The "strsafe" functions are an attempt to make C a tiny bit safer. “strsafe”函数试图使C更安全一些。 But C++ is already far safer. 但是C ++已经更加安全了。 Eg the StringCchPrintf function is not nearly as safe as std::osstream . 例如, StringCchPrintf函数并不像std::osstream那样安全。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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