当前位置: 技术问答>linux和unix
请教:编译《unix网络编程(第2版)》出现下面的错误,谢谢!
来源: 互联网 发布时间:2015-09-11
本文导语: 我在编译《unix网络编程(第2版)》时,出现下面的错误,是什么原因呀? 衷心谢谢各位回答的朋友! bash-2.05$ gcc daytimetcpcli01.c -o daytimetcpcli In file included from unp.h:13, from daytimetcpcli01.c:1...
我在编译《unix网络编程(第2版)》时,出现下面的错误,是什么原因呀? 衷心谢谢各位回答的朋友!
bash-2.05$ gcc daytimetcpcli01.c -o daytimetcpcli
In file included from unp.h:13,
from daytimetcpcli01.c:1:
/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/sys/types.h:85: error: conflicting t'
/usr/include/sys/int_types.h:69: error: previous declaration of `int32_t'
In file included from unp.h:200,
from daytimetcpcli01.c:1:
addrinfo.h:10: error: redefinition of `struct addrinfo'
bash-2.05$ gcc daytimetcpcli01.c -o daytimetcpcli
In file included from unp.h:13,
from daytimetcpcli01.c:1:
/usr/local/lib/gcc-lib/sparc-sun-solaris2.9/3.3.2/include/sys/types.h:85: error: conflicting t'
/usr/include/sys/int_types.h:69: error: previous declaration of `int32_t'
In file included from unp.h:200,
from daytimetcpcli01.c:1:
addrinfo.h:10: error: redefinition of `struct addrinfo'
|
unpv12e.tar.gz包是这样用的
gunzip -c unpv12e.tar.gz | tar xvf -
cd unpv12e
./configure # try to figure out all implementation differences
cd lib # build the basic library that all programs need
make # use "gmake" everywhere on BSD/OS systems
cd ../libfree # continue building the basic library
make
cd ../libgai # the getaddrinfo() and getnameinfo() functions
make
cd ../libroute # only if your system supports 4.4BSD style routing sockets
make # only if your system supports 4.4BSD style routing sockets
cd ../libxti # only if your system supports XTI
make # only if your system supports XTI
cd ../intro # build and test a basic client program
make daytimetcpcli
./daytimetcpcli 127.0.0.1
If all that works, you're all set to start compiling individual programs.
如果你要用gcc直接编译某个c程序, 因为系统和编译环境的原因, 是需要修改代码的
gunzip -c unpv12e.tar.gz | tar xvf -
cd unpv12e
./configure # try to figure out all implementation differences
cd lib # build the basic library that all programs need
make # use "gmake" everywhere on BSD/OS systems
cd ../libfree # continue building the basic library
make
cd ../libgai # the getaddrinfo() and getnameinfo() functions
make
cd ../libroute # only if your system supports 4.4BSD style routing sockets
make # only if your system supports 4.4BSD style routing sockets
cd ../libxti # only if your system supports XTI
make # only if your system supports XTI
cd ../intro # build and test a basic client program
make daytimetcpcli
./daytimetcpcli 127.0.0.1
If all that works, you're all set to start compiling individual programs.
如果你要用gcc直接编译某个c程序, 因为系统和编译环境的原因, 是需要修改代码的
|
blueflame(蓝色的火焰) ( ) 信誉:103 在另外一个帖子中写的
可以回答你的问题了
如果不行,你应该检查你的编译环境,这些代码我都编译过的,至于“关于这两本书的代码编译似乎许多人都有问题”是因为许多人都没看README
可以回答你的问题了
如果不行,你应该检查你的编译环境,这些代码我都编译过的,至于“关于这两本书的代码编译似乎许多人都有问题”是因为许多人都没看README