C语言 Windows 中的 C 头文件在哪里?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3119915/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where are the C header files in Windows?
提问by Scribble Master
I'm new to Windows development, having messed around in Linux for a while. I need to access console functions and am having trouble getting a comprehensive list of console text attributes off the web. I would like to read wincon.h and windows.h to get the info, but I can't figure out how to get at them. Help please!
我是 Windows 开发的新手,在 Linux 中混了一段时间。我需要访问控制台功能,但无法从网络上获取控制台文本属性的完整列表。我想阅读 wincon.h 和 windows.h 以获取信息,但我不知道如何获取它们。请帮忙!
采纳答案by Billy ONeal
Windows does not come with these by default. If you are looking for them, you need to install the Windows SDK and dig around in the %PROGRAMFILES%\Microsoft SDKs\Windows directory.
默认情况下,Windows 不附带这些。如果你正在寻找它们,你需要安装 Windows SDK 并在 %PROGRAMFILES%\Microsoft SDKs\Windows 目录中挖掘。
回答by Jerry Coffin
They're normally stored along with the other SDK headers. Assuming you're using Visual Studio, the easy to look at them is to create a file, add a line to #includethe file you care about, right click it, and click on the open document <whatever.h>line in the pop-up menu.
它们通常与其他 SDK 标头一起存储。假设您使用的是 Visual Studio,查看它们的简单方法是创建一个文件,#include在您关心的文件中添加一行,右键单击它,然后在open document <whatever.h>弹出菜单中单击该行。
回答by Timo Geusch
You'll have to install the Windows SDK to get the header files. Windows doesn't come with the software development tools out of the box and depending on which compiler you're using, they might not come with the compiler either.
您必须安装 Windows SDK 才能获取头文件。Windows 没有附带开箱即用的软件开发工具,根据您使用的编译器,它们也可能不附带编译器。

