gpt4 book ai didi

c - 通过 mingw 编译 win32 项目时缺少 sal.h

转载 作者:可可西里 更新时间:2023-11-01 09:35:17 25 4
gpt4 key购买 nike

错误信息:

fatal error: sal.h: No such file or directory cstudy line 11, external location: C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include\specstrings.h C/C++ Problem.

但是当我将 VC/include 添加到这个项目时,我收到了大量的错误信息。 VC/include/sal.h 似乎不是 GCC 的标准头文件。

源码很简单:

#include "windows.h"
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nCmdShow)
{

return 0;
}

环境:

  • Windows 7.0A SDK
  • 风投 2010
  • 明威
  • CDT/ECLIPSE。

谢谢。

最佳答案

不,sal.h header 不是 GCC/MinGW 的一部分,但是您可以添加 VC/include/作为 eclipse 的包含目录。

备选方案:所有 (!) 所需 header 移动到您的 mingw 或项目 include目录。来自 MinGw 的是:<mingw path>/include ).

Anyway. sal.h, if you install the Windows SDK then it isn't going to be in the SDK directory, but you should find that if you select to install the compiler and tools it will get installed along with that. This is because sal.h is needed in the CRT headers as well as the Windows headers. So you NEED to install the VS compilers and tools along with the SDK. You will then find that the compiler will be installed by default under %ProgramFiles%\Microsoft Visual Studio 2010\VC and sal.h will be in include under that path. On 64 bit systems it will be under %ProgramFiles(x86)% by default.

来源:http://social.msdn.microsoft.com/Forums/eu/windowssdk/thread/0e166050-99f1-436b-bd94-b39e2910f43d

参见:

关于c - 通过 mingw 编译 win32 项目时缺少 sal.h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9511433/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com