分页: 1 / 1

how to use compiler

发表于 : 2006-11-05 8:37
LaoLiulaoliu
I write helloword.cpp and makefile at /c.
I 've already install the gcc and g++.
how to use the compiler to output my words.
helloword.cpp
#include <stdio.h>
#include <iostream>
using namespace std;
int main() {
printf("Hello \n");
cout<<"World!!\n";
}
makefile
all:helloworld
helloworld:helloworld.cpp
\tg++ -g -o \$@ helloworld.cpp

发表于 : 2006-11-05 18:51
efan
啥意思?也不写有什么错误提示没~~~
我记得用make的话,不需要写makefile,一样可以用make helloword来编译。
另外,第一句的write应该用过去式,第二句的install应该用过去分词……

发表于 : 2006-11-06 17:48
LaoLiulaoliu
我是在新手上路指南上看到的,它说是测试环境,还用了ech0 ' '
我不懂。

发表于 : 2006-11-08 22:42
tick
最好能把错误提示贴出来

发表于 : 2006-11-09 21:16
LaoLiulaoliu
我意思是我写了一个程序,在VC下直接编译,连接就行了
但是在ubuntu下不会

发表于 : 2006-11-11 20:01
damnya
echo是为了把代码输出到某个文件,``不是'',是键盘1左边那个~键

thank you

发表于 : 2006-11-11 21:28
LaoLiulaoliu
I understand your meaning.