问题:
我尝试用Microsoft Visual C ++ 2010编译器编译一个简单的c ++源文件, 我遇到了一个错误。 我已安装Microsoft Visual C ++ 2010和MinGW并找到了windows.h文件, 我还在Code :: Blocks中配置了额外文件的目录。
代码:
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main(){
printf("Hello World!");
getchar();
}
错误:
F:\test2.cpp(3) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
答案 0 :(得分:2)
为了在使用Code :: Blocks IDE时使用多个编译器,您需要确保正确配置每个编译器的设置。这些可以通过Settings->Compiler
菜单选项访问。
选择要配置的编译器后,您需要选择Search Directories
标签,并确保Compiler
,Linker
和Resource Compiler
标签包含相应的文件夹。
每个选项卡可能需要在搜索框中输入几个文件夹。
使用Visual Studio C++ 2010
编译器的示例,每个选项卡将包含对两者的引用
在我的情况下,文件夹位置是:
<强>编译器强>
<强>链接器强>
资源编译器