c++ - 需要在 tchar.h 错误后包含 strsafe.h

标签 c++ visual-studio-2010 visual-studio visual-c++

我正在尝试使用 Visual Studio 2012 构建应用程序我在编译时遇到以下错误

C:\Program Files\Microsoft Visual Studio 11.0\VC\include\tchar.h(24): fatal error C1189: #error : 需要在 tchar.h 之后包含 strsafe.h

我在 stdafx.h 文件中的 strsafe.h 之后包含了 tchar.h。我仍然遇到同样的错误。如何解决这个问题

最佳答案

Reverse the order of inclusion? The error states that you should(*) include strsafe.h after tchar.h. – Joachim Pileborg May 31 '13 at 8:25

(*) == 必须

Move the #include for tchar.h up in the list of includes. And do consider not including it at all, these tchar practices date from the previous century. There is no version of Windows left that still needs it. The floppy disk drive on the last machine that still boots a non-Unicode version of Windows died last week, problem solved. – Hans Passant May 31 '13 at 12:50

关于c++ - 需要在 tchar.h 错误后包含 strsafe.h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16852925/

相关文章:

c++ - 使用 Args 的 n 个参数...从位置 m 开始

c# - XAML 更改 Togglebutton 内的图像源

visual-studio - 如何使用 Visual Studio Community (2019) 调试 vbscript

asp.net - Crystal Report直接保存为PDF,而不是查看

c++ - 在编译之前通过外部工具解析预处理源的任何方法?

c++ - Boost Spirit Qi 因内存违规而崩溃

.net - 部署 Azure 项目时出现依赖项警告 (WAT150)

c++ - 使用 string 和 int(like) 类型初始化模板类的静态成员

c++ - MS 构建错误 MSB8007 : The Platform for project 'MyProject.vcxproj' is invalid. 使用 MSBuild 针对自定义 SDK 构建 Visual Studio 项目

c++ - 不同参数计数的结构方法列表