UNIX 网络编程 编译环境出错 求解答 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
nougat2014

UNIX 网络编程 编译环境出错 求解答

  •  
  •   nougat2014 Oct 28, 2015 5211 views
    This topic created in 3843 days ago, the information mentioned may be changed or developed.

    刚刚开始看 UNIX 网络编程的书,下载了随书的程序源码,按照 README 文件进行环境配置的时候,在第二步 make 的时候出错了,出错原因如下:
    (开发环境是 cs50 给的虚拟机)
    jharvard@appliance (~/Downloads/unpv13e/lib): make
    clang -I../lib -ggdb3 -O0 -std=c99 -Wall -Werror -D_REENTRANT -Wall -c -o connect_nonb.o connect_nonb.c
    In file included from connect_nonb.c:1:
    In file included from ../lib/unp.h:13:
    /usr/include/i386-linux-gnu/sys/types.h:109:19: error: cannot combine with
    previous 'type-name' declaration specifier
    typedef __ssize_t ssize_t;
    ^
    ../lib/../config.h:311:17: note: expanded from macro 'ssize_t'

    define ssize_t int

    ^ 

    In file included from connectnonb.c:1:
    In file included from ../lib/unp.h:13:
    In file included from /usr/include/i386-linux-gnu/sys/types.h:146:
    /usr/bin/../lib/clang/3.4/include/stddef.h:42:23: error: cannot combine with
    previous 'int' declaration specifier
    typedef __SIZE_TYPE
    _ size_t;
    ^
    ../lib/../config.h:302:25: note: expanded from macro 'size_t'

    define size_t unsigned int

    ^ 

    In file included from connectnonb.c:1:
    In file included from ../lib/unp.h:13:
    /usr/include/i386-linux-gnu/sys/types.h:196:1: error: cannot combine with
    previous 'int' declaration specifier
    __intN_t (32, __SI
    );
    ^
    /usr/include/i386-linux-gnu/sys/types.h:188:15: note: expanded from macro
    '
    intN_t'
    typedef int int##N##_t __attribute
    _ ((mode (MODE)))
    ^
    <scratch space>:14:1: note: expanded from here
    int32_t
    ^
    ../lib/../config.h:296:17: note: expanded from macro 'int32_t'

    define int32_t int

    ^ 

    In file included from connect_nonb.c:1:
    In file included from ../lib/unp.h:14:
    In file included from /usr/include/i386-linux-gnu/sys/socket.h:38:
    /usr/include/i386-linux-gnu/bits/socket.h:33:21: error: cannot combine with
    previous 'type-name' declaration specifier
    typedef __socklen_t socklen_t;
    ^
    ../lib/../config.h:305:28: note: expanded from macro 'socklen_t'

    define socklen_t unsigned int

    ^ 

    In file included from connect_nonb.c:1:
    In file included from ../lib/unp.h:14:
    In file included from /usr/include/i386-linux-gnu/sys/socket.h:38:
    /usr/include/i386-linux-gnu/bits/socket.h:33:21: errr: 'type-name' cannot be
    signed or unsigned
    ../lib/../config.h:305:19: note: expanded from macro 'socklen_t'

    define socklen_t unsigned int

    ^ 

    In file included from connect_nonb.c:1:
    In file included from ../lib/unp.h:25:
    In file included from /usr/include/netinet/in.h:22:
    In file included from /usr/bin/../lib/clang/3.4/include/stdint.h:62:
    In file included from /usr/bin/../lib/gcc/i686-linux-gnu/4.8/include/stdint.h:9:
    /usr/include/stdint.h:48:24: error: cannot combine with previous 'char'
    declaration specifier
    typedef unsigned char uint8_t;
    ^
    ../lib/../config.h:326:26: note: expanded from macro 'uint8_t'

    define uint8_t unsigned char

    ^ 

    In file included from connect_nonb.c:1:
    In file included from ../lib/unp.h:25:
    In file included from /usr/include/netinet/in.h:22:
    In file included from /usr/bin/../lib/clang/3.4/include/stdint.h:62:
    In file included from /usr/bin/../lib/gcc/i686-linux-gnu/4.8/include/stdint.h:9:
    /usr/include/stdint.h:51:23: error: cannot combine with previous 'int'
    declaration specifier
    typedef unsigned int uint32_t;
    ^
    ../lib/../config.h:323:27: note: expanded from macro 'uint32_t'

    define uint32_t unsigned int

    ^ 

    In file included from connect_nonb.c:1:
    ../lib/unp.h:227:8: error: redefinition of 'sockaddr_storage'
    struct sockaddr_storage {
    ^
    /usr/include/i386-linux-gnu/bits/socket.h:162:8: note: previous definition is
    here
    struct sockaddr_storage
    ^
    In file included from connect_nonb.c:1:
    ../lib/unp.h:263:8: error: redefinition of 'timespec'
    struct timespec {
    ^
    /usr/include/time.h:120:8: note: previous definition is here
    struct timespec
    ^
    In file included from connect_nonb.c:1:
    ../lib/unp.h:286:1: error: unknown type name 'u_char'
    u_char inet_srcrt_init(int);
    ^
    ../lib/unp.h:287:24: error: unknown type name 'u_char'
    void inet_srcrt_print(u_char *, int);
    ^
    ../lib/unp.h:458:21: error: type specifier missing, defaults to 'int'
    [-Werror,-Wimplicit-int]
    void Sysctl(int *, u_int, void *, size_t *, void *, size_t);
    ^~~~~
    12 errors generated.
    make: *
    * [connect_nonb.o] Error 1

    No Comments Yet
    About     Help     Advertise     Blog     API     FAQ     Solana     1425 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 41ms UTC 16:57 PVG 00:57 LAX 09:57 JFK 12:57
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86