超级菜鸟第一次用gcc有问题请教,在线等回答,谢谢
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
-
- 帖子: 3
- 注册时间: 2009-09-26 10:16
超级菜鸟第一次用gcc有问题请教,在线等回答,谢谢
因为计算需要运行一个linux下的程序,第一次使用Ubuntu,自己是电脑菜鸟,没有编程知识。敬请大家帮忙。
按照程序的manual
我输入>>gcc ssweep.c -o ssw -lm
得到结果:bash:swweep.c: command not found
请问-0和-lm是什么意思?
得到这个结果是什么意思?如何解决?
按照程序的manual
我输入>>gcc ssweep.c -o ssw -lm
得到结果:bash:swweep.c: command not found
请问-0和-lm是什么意思?
得到这个结果是什么意思?如何解决?
-
- 帖子: 3
- 注册时间: 2009-09-26 10:16
Re: 超级菜鸟第一次用gcc有问题请教,在线等回答,谢谢
此外,我运行sudo apt-get build-essential
显示:E:无效的操作 build-essential
怎么回事?
显示:E:无效的操作 build-essential
怎么回事?
-
- 帖子: 3182
- 注册时间: 2006-03-10 15:10
- 来自: xi'an China
- 联系:
Re: 超级菜鸟第一次用gcc有问题请教,在线等回答,谢谢
同一个原因,你输错了。从哪儿看到了,可以复制粘贴的
- slax
- 帖子: 1099
- 注册时间: 2009-08-17 3:52
- slax
- 帖子: 1099
- 注册时间: 2009-08-17 3:52
Re: 超级菜鸟第一次用gcc有问题请教,在线等回答,谢谢
of course,you can use some IDE like codeblocks anjuta and so on.
-
- 帖子: 3
- 注册时间: 2009-09-26 10:16
Re: 超级菜鸟第一次用gcc有问题请教,在线等回答,谢谢
thank you very much.
For the first question. I have cd to my directory and input right command. but the result is the same.
For the second question. slax is right. thanks
For the first question. I have cd to my directory and input right command. but the result is the same.
For the second question. slax is right. thanks
- jioyo源
- 帖子: 3476
- 注册时间: 2008-10-08 13:48
Re: 超级菜鸟第一次用gcc有问题请教,在线等回答,谢谢
先找本基础教程 看一下,然后再有不懂的再来论坛问……
--------------------------------------
论坛精华贴全集:http://forum.ubuntu.org.cn/viewtopic.php?f=48&t=199845
book:http://forum.ubuntu.org.cn/viewtopic.php?f=21&t=198286
论坛精华贴全集:http://forum.ubuntu.org.cn/viewtopic.php?f=48&t=199845
book:http://forum.ubuntu.org.cn/viewtopic.php?f=21&t=198286
- BigSnake.NET
- 帖子: 12522
- 注册时间: 2006-07-02 11:16
- 来自: 廣州
- 联系:
Re: 超级菜鸟第一次用gcc有问题请教,在线等回答,谢谢
你不是把那个 >> 也输入了吧 =。= 。。sunnyorc 写了:thank you very much.
For the first question. I have cd to my directory and input right command. but the result is the same.
For the second question. slax is right. thanks
^_^ ~~~
要理解递归,首先要理解递归。
地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
要理解递归,首先要理解递归。
地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
- slax
- 帖子: 1099
- 注册时间: 2009-08-17 3:52
Re: 超级菜鸟第一次用gcc有问题请教,在线等回答,谢谢
莫非你和我一样,刚才scim崩溃了?sunnyorc 写了:thank you very much.
For the first question. I have cd to my directory and input right command. but the result is the same.
For the second question. slax is right. thanks
- slax
- 帖子: 1099
- 注册时间: 2009-08-17 3:52
Re: 超级菜鸟第一次用gcc有问题请教,在线等回答,谢谢
bash:swweep.c: command not foundBigSnake.NET 写了:你不是把那个 >> 也输入了吧 =。= 。。sunnyorc 写了:thank you very much.
For the first question. I have cd to my directory and input right command. but the result is the same.
For the second question. slax is right. thanks
好像gcc 被忽略了,莫非是真的把>>给打进去了?
将swweep.c 重命名 为 main.c 再将下面的文字复制成 makefile 文件放在同目录下,在终端下 make 运行
代码: 全选
# 源文件
c_source_files := main.c
c_header_files :=
# 输出文件
executable_files := main
object_files := $(patsubst %.c, %.o, $(c_source_files))
CFLAGS +=
LDLIBS +=
CFLAGS ?= -g -O0
CFLAGS += -Wall -Wextra
.PHONY: all
all: $(executable_files)
#------------------------------------
$(executable_files): $(object_files)
$(LINK.o) $^ $(LDLIBS) -o $@
$(executable_files).o: $(c_source_files) $(c_header_files)
$(COMPILE.c) $< -o $@
#--------------------------------------
# make clean
# 仅删除编译生成的.o文件,保留可执行文件和*.log
.PHONY: clean
clean:
$(RM) $(object_files)
#------------------------------------
# make distclean
# 删除*.o、可执行文件以及*.log
.PHONY: distclean
distclean:
$(RM) $(object_files)
$(RM) $(executable_files)
$(RM) $(log_files)