分页: 1 / 1

谁教我eclipse的c++ IDE怎么用啊?

发表于 : 2009-05-26 22:17
hikui
最近看到eclipse有单独的C++ide下载,于是下载了(貌似还是绿色软件,双击运行)。写了一个hello world,但是编译出错 :em06

代码: 全选

#include<iostream>
using namespace std;
int main()
{
	cout<<"hello world"<<endl;
	return 0;
}
这个不会有问题吧。
g++和GCC都装了。好像是编译的时候出错了。看了一下终端,显示:
**** Build of configuration Debug for project cpptest ****

make all
Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.cpp"
Finished building: ../main.cpp

Building target: cpptest
Invoking: GCC C++ Linker
g++ -o"cpptest" ./main.o
/usr/lib/gcc/i486-linux-gnu/4.3.3/../../../../lib/crt1.o: In function `_start':
/build/buildd/glibc-2.9/csu/../sysdeps/i386/elf/start.S:115: undefined reference to `main'
collect2: ld 返回 1
make: *** [cpptest] 错误 1

Re: 谁教我eclipse的c++ IDE怎么用啊?

发表于 : 2009-05-26 23:37
hikui
囧死了。。原来eclipse在按下build的瞬间不会自动保存.cpp文件的。。。。所以那个cpp文件是空的。。。。
所以才会提示没有main函数。。 :em06

Re: 谁教我eclipse的c++ IDE怎么用啊?

发表于 : 2009-10-04 15:08
chibisam
和楼主一样的情况。。呃 这真是菜鸟不了解使用导致的白痴错误阿。。。呵呵 我是大菜鸟

Re: 谁教我eclipse的c++ IDE怎么用啊?

发表于 : 2009-10-04 15:39
honghong
honghong@honghong-laptop:~/tmp$ g++ honghong.cpp
honghong.cpp:1:20: error: isotream: 没有该文件或目录
honghong.cpp:3: error: ‘::main’ must return ‘int’
honghong.cpp: In function ‘int main()’:
honghong.cpp:4: error: ‘cout’ was not declared in this scope
honghong.cpp:4: error: ‘endl’ was not declared in this scope
这是我的问题,大家也帮我看看

Re: 谁教我eclipse的c++ IDE怎么用啊?

发表于 : 2009-10-04 15:39
honghong
我用的一样的代码

Re: 谁教我eclipse的c++ IDE怎么用啊?

发表于 : 2009-10-04 15:44
wangdu2002
楼上找出Linux的基础编程书瞧下。你的编译命令不对。

Re: 谁教我eclipse的c++ IDE怎么用啊?

发表于 : 2009-10-26 17:39
myselfjdq
请问你的eclipse怎么安装的啊 我是新手 可不可以把教我一下或是把安装包发给我好吗?

我的邮箱:[email protected]

Re: 谁教我eclipse的c++ IDE怎么用啊?

发表于 : 2009-10-26 18:01
sirniu
myselfjdq 写了:请问你的eclipse怎么安装的啊 我是新手 可不可以把教我一下或是把安装包发给我好吗?

我的邮箱:[email protected]
只需要打开新立得软件管理器搜索eclipse,然后把Eclipse和eclipse-cdt标记安装就行了 :em11

Re: 谁教我eclipse的c++ IDE怎么用啊?

发表于 : 2009-10-27 16:52
myselfjdq
sirniu 写了:
myselfjdq 写了:请问你的eclipse怎么安装的啊 我是新手 可不可以把教我一下或是把安装包发给我好吗?

我的邮箱:[email protected]
只需要打开新立得软件管理器搜索eclipse,然后把Eclipse和eclipse-cdt标记安装就行了 :em11

那个上面的资源太慢了 能不能来个直接点的嘛

Re: 谁教我eclipse的c++ IDE怎么用啊?

发表于 : 2009-12-09 10:22
wholiu
是你的源的问题吧。换个快点的源就好了!