c++变异问题 对‘std::ios_base::Init::Init()’未定义的引用
来源:互联网 发布:小米6数据连接上不了网 编辑:程序博客网 时间:2024/05/18 07:14
写了一个简单的程序如下:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello" <<endl;
return 0;
}
在编译的时候如下错误。
gcc -o One -g TestOne.cpp
/tmp/cc5TITlz.o:在函数‘main’中:
/home/you/STL/vector/TestOne.cpp:6:对‘std::cout’未定义的引用
/home/you/STL/vector/TestOne.cpp:6:对‘std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)’未定义的引用
/home/you/STL/vector/TestOne.cpp:6:对‘std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)’未定义的引用
/home/you/STL/vector/TestOne.cpp:6:对‘std::ostream::operator<<(std::ostream& (*)(std::ostream&))’未定义的引用
/tmp/cc5TITlz.o:在函数‘__static_initialization_and_destruction_0’中:
/usr/include/c++/4.8.2/iostream:74:对‘std::ios_base::Init::Init()’未定义的引用
/usr/include/c++/4.8.2/iostream:74:对‘std::ios_base::Init::~Init()’未定义的引用
collect2: 错误:ld 返回 1
在论坛上找到大神后,才知道,犯了一个低级的错误。
”这是c++,不是c“
因此改为如下:
g++ -o One -g TestOne.cpp
一切OK。
~
- c++变异问题 对‘std::ios_base::Init::Init()’未定义的引用
- undefined reference to `std::ios_base::Init::Init()
- undefined reference to `std::ios_base::Init::Init()
- “std::ios_base::Init::Init()”,referenced from 错误
- std::ios_base::Init::Init()”,referenced from 引用C++文件报错
- ubuntu下 GCC编译程序出现 undefined reference to `std::ios_base::Init::Init()'问题
- ubuntu下 GCC编译程序出现 undefined reference to `std::ios_base::Init::Init()'问题
- ubuntu下 GCC编译程序出现 undefined reference to `std::ios_base::Init::Init()'问题
- GCC编译程序出现 undefined reference to `std::ios_base::Init::Init()'问题
- ios 编译过程中碰到std::ios_base::Init::~Init()错误的问题解决方法
- ios 编译过程中碰到std::ios_base::Init::~Init()错误的问题解决方法
- 错误集锦5--“std::ios_base::Init::Init()”,referenced from 错误
- std::ios_base::Init::Init()”,referenced from 错误解决
- ubuntu下 GCC编译程序出现 undefined reference to `std::ios_base::Init::Init()'问题——gcc编译C++代码
- 对‘std::xxx’未定义的引用
- NDK 编译时出现 algorithm,vector std::ios_base::Init::Init() , 以及ostream等问题解决方案
- 在ubuntu下搭建C++的开发环境出现std::init未定义
- error: std::ios_base::ios_base(const std::ios_base&)’是私有的
- Android开发随记(2)-- onClick事件统一处理、系统界面跳转
- RHEL6下获取安装包(RPM)而不安装的方法
- 第27课时,自测
- 将数据成员改为私人的(第二章第二题)
- C语言简单模拟ArrayList
- c++变异问题 对‘std::ios_base::Init::Init()’未定义的引用
- 【Unity】数据持久化
- 雨滴效果
- java web项目启动时浏览器路径不用输入项目名称方法
- 研发流程中的产品测试
- Spinners
- UVa 514 数据结构栈
- 【erlang 002】erlang中的错误及异常处理
- node.js 前后台传值的问题