MinGW编译提示找不到iostream

codeblocks + MinGW进行简单的C++程序开发。为了测试搭建平台是否完成,只写个HelloWorld来编译测试一下。

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}

结果连编译都过不了:

-------------- Build: Debug in btest (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -fexceptions -g  -c D:\btest\main.cpp -o obj\Debug\main.o
D:\btest\main.cpp:1:20: fatal error: iostream: No such file or directory
 #include <iostream>
                    ^
compilation terminated.

path中已加入MinGW路径:

%MinGW%\bin;%MinGW%\mingw32\bin;

另外codeblock中编译环境设置如图:
图片描述

请问环境搭建存在什么问题?应如何排查?

阅读 9.7k
1 个回答
新手上路,请多包涵

试试eclipse-cdt

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题