如何利用小游戏调试工具提升小程序开发效率,提升开发效率与合规性
566
2022-09-24
不知道如何运行unix网络编程下面的代码
最近下了本电子书,unix网络编程,我的安装的操作系统是CentOS 5.5 ,把源代码导入之后,按照着readme.txt那个说明编译运行了一遍,发现有些报错内容,忽略过去了,但是就是运行第一个程序的时候就报错,非常郁闷:
[root@localhost intro]# ./daytimetcpcli1 127.0.0.1-bash: ./daytimetcpcli1: No such file or directory[root@localhost intro]# ./daytimetcpcli 127.0.0.1connect error: Connection refused
本来是想学C语言的网络编程的,但是第一个程序就跑不起来,对我的打击相当的大啊,在网上找了半天也没有详细的说明如何用里面的方法,都是很大牛的口气告诉新手,直接改代码吧。。。让我很是无奈。。。
我只知道用C写的源文件可以用gcc来编译,但是里面的源代码我用GCC这个命令来编译,就报一大堆的错,相当的郁闷。。。
[root@localhost intro]# ./daytimetcpcli1.c 127.0.0.1./daytimetcpcli1.c: line 3: int: command not found./daytimetcpcli1.c: line 4: syntax error near unexpected token `int'./daytimetcpcli1.c: line 4: `main(int argc, char **argv)'[root@localhost intro]# gcc daytimetcpcli1.c daytimetcpcli1.c:1:17: error: unp.h: No such file or directorydaytimetcpcli1.c: In function amaina:daytimetcpcli1.c:7: error: aMAXLINEa undeclared (first use in this function)daytimetcpcli1.c:7: error: (Each undeclared identifier is reported only oncedaytimetcpcli1.c:7: error: for each function it appears in.)daytimetcpcli1.c:8: error: storage size of aservaddra isnat knowndaytimetcpcli1.c:13: error: aAF_INETa undeclared (first use in this function)daytimetcpcli1.c:13: error: aSOCK_STREAMa undeclared (first use in this function)daytimetcpcli1.c:16: warning: incompatible implicit declaration of built-in function abzeroadaytimetcpcli1.c:22: error: aSAa undeclared (first use in this function)daytimetcpcli1.c:22: error: expected expression before a)a tokendaytimetcpcli1.c:28: error: astdouta undeclared (first use in this function)daytimetcpcli1.c:28: error: aEOFa undeclared (first use in this function)daytimetcpcli1.c:34: warning: incompatible implicit declaration of built-in function aprintfadaytimetcpcli1.c:35: warning: incompatible implicit declaration of built-in function aexita
我准备下个FreeBSD来试试,莫非是操作系统的版本不对的问题吗。。。
总之,这次尝试是让我相当的不开心啊
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~