简体   繁体   English

如何在 atom 中包含 iostream?

[英]How can i include iostream in atom?

I am trying to start learning C++ and I am having an issue with atom.我正在尝试开始学习 C++,但我遇到了 atom 的问题。 I tried running this very simple code:我尝试运行这个非常简单的代码:

#include <iostream>
using namespace std;

int main () {
  cout << "HelloWorld";
  return 0;
}

and got a fatal error saying that the file iostream was not found.并收到一个致命错误,指出未找到文件 iostream。 I installed xcode and I am able to run the code on xcode.我安装了 xcode,并且能够在 xcode 上运行代码。 I would much rather use atom than xcode.我宁愿使用原子而不是 xcode。 Does anyone know how to include iostream in atom?有谁知道如何在atom中包含iostream?

Thank you for your help!感谢您的帮助!

That error must be due to the wrong extension.该错误一定是由于错误的扩展名造成的。 Make sure you saved the file with .cpp extension.确保使用.cpp扩展名保存文件。

Also, make sure the GCC compiler is installed and the path is set up correctly.另外,请确保安装了 GCC 编译器并正确设置了路径。

Please refer this .请参考这个

Please provide more details regarding the error.请提供有关错误的更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM