[问题]C++无法正常编译.

软件和网站开发以及相关技术探讨
回复
Ejkoy
帖子: 11
注册时间: 2006-10-18 15:13

[问题]C++无法正常编译.

#1

帖子 Ejkoy » 2006-10-19 13:18

我是用 sudo apt-get build-dep gcc
安装的 GCC.
但是无法正确编译C++文件. 例如一旦#include<iostream>
就会出现

代码: 全选

/tmp/ccXI42UO.o: In function `__static_initialization_and_destruction_0(int, int)':
main.cpp:(.text+0x3d):对‘std::ios_base::Init::Init()’未定义的引用
/tmp/ccXI42UO.o: In function `__tcf_0':
main.cpp:(.text+0x86):对‘std::ios_base::Init::~Init()’未定义的引用
/tmp/ccXI42UO.o:(.eh_frame+0x11):对‘__gxx_personality_v0’未定义的引用
collect2: ld returned 1 exit status
头像
jiangpeng
帖子: 223
注册时间: 2006-07-25 9:33
联系:

#2

帖子 jiangpeng » 2006-10-19 19:49

sudo apt-get install g++
Take what man makes and use it, But do not worship it, For it shall pass. -- Anonymous

Twitter @jiangpeng
ahwhhome
帖子: 3
注册时间: 2006-05-10 15:49

#3

帖子 ahwhhome » 2006-10-24 15:24

#include <iostream>

using namespace std;
dbzhang800
帖子: 3182
注册时间: 2006-03-10 15:10
来自: xi'an China
联系:

Re: [问题]C++无法正常编译.

#4

帖子 dbzhang800 » 2006-10-24 15:39

Ejkoy 写了:我是用 sudo apt-get build-dep gcc
安装的 GCC.
但是无法正确编译C++文件. 例如一旦#include<iostream>
就会出现
编译的时候用
g++ test.cpp
而不是
gcc test.cpp
回复