Iostream库不包含在代码块中
iostream library not included in codeblocks
我目前正在尝试代码块为我的c++编程,但我有麻烦让它编译,我没有在过去有过这个问题,我最近才开发它,我已经搜索谷歌徒劳的解决方案,最接近我是Code::块编译错误这并没有解决我的问题,我已经多次尝试卸载和安装代码块和mingw。错误是:
1|fatal error: iostream: No such file or directory|
||=== Build finished: 1 errors, 0 warnings (0 minutes, 0 seconds) ===|
它只是一个基本的hello world程序在我的设置我有c++编译器列为mingw32-g++.exe。我已经尝试了好几天,让这个工作,请帮助。
#include <iostream>
using namespace std;
int main()
{
cout << "hello worldn";
return 0;
}
我遇到了同样的问题,那就是我将文件保存为c文件(例如HelloWorld.c)。当我将文件更改为HelloWorld.cpp开始工作时。因此,将文件名更改为。cpp
你把iostream文件放错地方了吗?
/* Using standard C++ calling (note that you should use namespace std for cout or add using namespace std;) */
#include <iostream>
int main()
{
std::cout<<"Hello World!n";
return 0;
}
我解决了这个问题只需使用c++编译器比如g++ g++ your project -o test
然后是./test
你的项目=你的文本代码的名称,如果你使用g++,还有一个注意事项你的文件在桌面打开文件管理器,点击桌面右键点击桌面(文件管理器)点击"打开终端"然后完成
我也有同样的"#include<没有这样的文件或目录错误!!但在我的例子中,这可能是扩展问题。Codeblocks将其保存为。c(默认扩展名)。只需保存程序的名称,后跟cpp。像"Myprogram.cpp"。希望对您有所帮助.....>
相关文章:
- 编译包含字符串的代码时遇到问题
- 在混合代码库中将C转换为C++时出现许多包含错误
- 在C++代码中包含opencv时,使用ctypes创建.so文件
- 如何将外部代码包含在虚幻引擎4 C++项目中
- 如果代码包含多个复杂度循环,如何计算复杂度
- 如何使用 cmake 在代码中包含、构建和调试共享库 (.so)?
- 在 C++ 对象包装器中安全地包含 C 代码
- 为什么我的代码包含错误分段错误(核心转储)?
- 如何在此代码中包含 While 语句
- 在源文件中包含额外的调试信息,以便在代码::块中使用gdb进行调试
- 在Visual Studio代码中包含自定义c++库的问题
- 当我在结构中包含多个数组时,我的程序会跳过一堆代码
- C++:汇编代码包含断言结果
- 如何为代码包含负值?号码系统转换
- C++模板可以用于条件代码包含吗
- 如何将文件作为字符串和代码包含在cpp中
- C++代码包含错误
- c++宏:条件代码包含在表达式NOT语句中
- 端口C代码包含复数到c++
- 将模板代码包含在多个编译单元中,它将始终链接而不内联