c - Visual Studio 2008错误:ATL

标签 c visual-studio visual-studio-2008 atl

出现此编译错误:

Error 4107 fatal error C1189: #error : ATL requires C++ compilation (use a .cpp suffix) C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlbase.h 59

如何解决这个问题?

最佳答案

正如错误消息所述。如果您的源文件以 .c 结尾,编译器会假定它是直接的 C 源代码,与 ATL 所需的 C++ 不兼容。将文件名更改为 .cpp 即可编译。

如果您确实需要继续使用 C,那么您将不得不寻找 ATL 以外的其他库来帮助您。

关于c - Visual Studio 2008错误:ATL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15263443/

相关文章:

c - setbkcolor() 在 Dev-C++ 4.9.9.2 中无效

c# - 是否有(更好的)方法来查找对属性 setter 的所有引用?

css - 验证 (CSS 2.1) : 'behavior' is not a known CSS property name

.net - 为什么在我向窗体添加控件后 Visual C++ Designer 不工作?

.net - 将 Web 应用程序项目拆分为多个项目

c - 使用单独的函数检查它是否是整数输入 C 语言

c - 哪个 API 用于在 Windows 上加密休眠文件?

c++ - strdup() 和 strcpy

visual-studio - 是否有与Visual Studio "Command Window"等效的 eclipse ?

javascript - 为什么我总是抛出这个错误? Node : internal/modules/cjs/loader 944 Throw Err ^ (Cannot find module)