原因:
C++ 1998 要求cout and endl被调用使用'std::cout'和'std::endl'格式,或using namespace std;

修改后:
#include<iostream>

std::cout << "Hello World!" << std::endl;

或者

#include<iostream>
using namespace std;

error: `cout' was not declared in this scope的更多相关文章

  1. error: 'LOGE' was not declared in this scope

    移植了下HAL,发现编译出现如下错误 error: 'LOGE' was not declared in this scope 比较了一下android4.1的 system/core/include ...

  2. c++ - fcgio.cpp:50: error: 'EOF' was not declared in this scope - Stack Overflow

    c++ - fcgio.cpp:50: error: 'EOF' was not declared in this scope - Stack Overflow fcgio.cpp:50: error ...

  3. 【QT】error: 'SIGNAL' was not declared in this scope

    error: 'SIGNAL' was not declared in this scope  未在此范围内声明. connect(ui->Btnshowhello,SIGNAL(clicked ...

  4. [Error] 'exit' was not declared in this scope的解决方法

    新手刚开始用Linux和c++写程序,可能会出现下面的错误 error: ‘exit’ was not declared in this scope 解决方法是 添加 #include <cst ...

  5. 解决Cygwin编译cocos2dx 遇到的 error: 'UINT64_C' was not declared in this scope 问题

    环境工具:Win10.VS2013.cocos2d-x-2.2.6.Cygwin.ADT 问题来源:写了一个小游戏,VS2013上运行成功,就尝试着打包apk,项目导入到ADT里面,添加了cocos2 ...

  6. 编译是报error: 'EVNET_COME_TO_FOREGROUND' was not declared in this scope

    Compile++ thumb  : game_shared <= main.cpp jni/hellocpp/main.cpp: In function 'void Java_org_coco ...

  7. 调用ffmpeg库编译时出现common.h:175:47: error: 'UINT64_C' was not declared in this scope

    解决办法 出现错误:jni/ffmpeg/libavutil/common.h:175:47: error: 'UINT64_C' was not declared in this scope 解决: ...

  8. In function 'int av_clipl_int32_c(int64_t)': error: 'UINT64_C' was not declared in this scope

    cygwin下使用ndk编译jni时遇到的错误: /ffmpeg/include/libavutil/common.h: In function 'int av_clipl_int32_c(int64 ...

  9. error: ‘errno’ was not declared in this scope

    问题: 将一个c文件改为cpp文件,其中的perror()改用C++中的std::cerr << strerror(error) << std::endl;来替换. 重新编译文 ...

随机推荐

  1. Python自学:第三章 使用方法pop()删除元素

    motorcycle = ["honda", "yamaha", "suzuki"] last_owned = motorcycle.pop ...

  2. BaseDao封装

    1.lombok 1) 在pom.xml中导入依赖 <!--导入lombok--> <!-- https://mvnrepository.com/artifact/org.proje ...

  3. Fiddler抓取https请求 & Fiddler抓包工具常用功能详解

    Fiddler抓取https请求 & Fiddler抓包工具常用功能详解   先来看一个小故事: 小T在测试APP时,打开某个页面展示异常,于是就跑到客户端开发小A那里说:“你这个页面做的有问 ...

  4. prometheus监控示例

    prometheus架构图 prometheus 各组件介绍 Prometheus Server: 使用pull方式采集监控数据,在该组件上配置监控数据的采集和告警规则. Client Library ...

  5. linux top指令信息表示

    top指令: PID ====  进程号 USER ==== 进程所有者 PR ====  进程优先级 NI ====  进程优先级别数值 VIRT ==== 进程占用的虚拟内存 RES ====   ...

  6. kindle完结书单

    1.一个人的好天气---青山七惠 2.嫌疑人X的献身---东野圭吾 3.活着---余华 4.最漫长的旅行---Nicholas Sparks 5.解忧杂货店---东野圭吾 6.追风筝的人---卡勒德· ...

  7. The innodb_system data file 'ibdata1' must be writable

    在安装MySQL的时候报的错,我理解的这个错是因为有个文件是Innodb需要在安装MySQL(或者创建数据库的时候)的时候需要写入这个文件,但是他现在没有写的权限. 日志中的错误是: 5.7版本以前是 ...

  8. 如何用python将一个时间序列转化成有监督学习

    机器学习可以被用于时间序列预测. 在机器学习能使用之前,时间序列预测需要被重新转化成有监督学习.将一个序列组合成成对的输入输出序列. 在这篇教程中,你会发现如何通过使用机器学习算法将单变量和多变量的时 ...

  9. jquery实现下拉加载更多

    下拉加载更多这种原理很容易想明白,但是不自己写一个简单的,老是不踏实,获取什么高度再哪里获取之类的.于是自己简单写了个,就是页面上有几个div,然后当滚动条拉到某个位置的时候,再继续加载div.顺便又 ...

  10. httpd-2.4基本使用及lamp基础(01)

    Centos 6 默认安装http版本为2.2,如果想安装2.4版本则需要升级apr centos6默认:apr-1.3.9,apr-util-1.3.9 编译安装步骤: 1.4+版的apr和apr- ...