compiler-errors - 编程新手,无法让Visual Studio 2013打开包含文件

标签 compiler-errors fatal-error

我正在经历学习C++的缓慢过程,并且遇到了一个使我完全困惑的问题。

我正在尝试从www.stroustrup.com/Programming/std_lib_facilities.h保存自​​定义 header ,并获取我的.cpp文件以在目录中打开它。我已经将 header 与.cpp文件保存在同一目录中,这就是VS中的代码的样子

#include <header1.h>

int main()
{
    cout << "its bumming me out pretty bad\n";
    return 0;
}

最佳答案

首先,include应该是这样的:

#include "header1.h"

而且如果不包括iostream就不能使用cout,所以它最终应该看起来像:
#include "header1.h"
#include <iostream>
using namespace std;

int main()
{
    cout << "its bumming me out pretty bad\n";
    return 0;
}

关于compiler-errors - 编程新手,无法让Visual Studio 2013打开包含文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27672894/

相关文章:

php - !空(修剪($_POST ['username']

python - 我最近更改了编译器路径以运行c++代码,但是现在我无法运行任何python代码。我该如何解决?

c++ - 我如何制作一个允许所有左值引用、右值引用和 initializer_list 的模板化构造函数?

ios - 尝试设置 PFUser 的个人资料图片时出现 fatal error

导致 Resource$NotFoundException 的 Android 自定义按钮状态选择器 XML 文件

php - 警告 : `exec()` has been disabled for security reasons

php - PHPUnit 测试可以预料到 fatal error 吗?

haskell - 在输入 `='上解析错误?

scala - Scala : compilation error: not found type

c - fatal error : cannot execute 'as' : execvp: no such file or directory