记录一次搭建unix网络编程环境过程中遇到的问题和总结
计算机环境虚拟机 linuxmint-18-xfce-64bit
1.打开unix网络编程.iso
把目录下的文件复制到某一目录,修改权限,可命令可鼠标操作。
2.
s@ss-Linux ~/unix/unpv13e $ sudo su [sudo] s 的密码: ss-Linux unpv13e # ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for gcc... gcc checking for C compiler default output... configure: error: C compiler cannot create executables See `config.log' for more details.
很明显在检测环境时gcc无法生成可执行文件。
于是我又执行了一次configure,还是同样的结果。
我查看了一下config.log也看不大明白。
上网翻博客。。。也没查到相关内容。
3.突发奇想,编译器出现问题,不如换个编译器。
s-Linux unpv13e # apt-get install g++ 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 将会同时安装下列软件: binutils cpp-5 g++-5 gcc-5 gcc-5-base gcc-5-base:i386 libasan2 libatomic1 libc-dev-bin libc6-dev libcc1-0 libcilkrts5 libgcc-5-dev libgfortran3 libgomp1 libitm1 liblsan0 libmpx0 libquadmath0 libstdc++-5-dev libstdc++6:i386 libstdc++6 libtsan0 libubsan0 建议安装: binutils-doc gcc-5-locales g++-multilib g++-5-multilib gcc-5-doc libstdc++6-5-dbg gcc-5-multilib libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan2-dbg liblsan0-dbg libtsan0-dbg libubsan0-dbg libcilkrts5-dbg libmpx0-dbg libquadmath0-dbg glibc-doc libstdc++-5-doc 下列【新】软件包将被安装: g++ g++-5 libc-dev-bin libc6-dev libstdc++-5-dev 下列软件包将被升级: binutils cpp-5 gcc-5 gcc-5-base gcc-5-base:i386 libasan2 libatomic1 libcc1-0 libcilkrts5 libgcc-5-dev libgfortran3 libgomp1 libitm1 liblsan0 libmpx0 libquadmath0 libstdc++6:i386 libstdc++6 libtsan0 libubsan0 。。。。。。。。(略)
上面可以看到gcc等,希望有用。
4.再次执行configure
ss-Linux unpv13e # ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ranlib... ranlib checking for pthread_create in -lpthread... yes checking for t_open in -lnsl... no checking for library containing socket... none required checking for /usr/local/bind/lib/libbind.a... no checking for /root/libbind.a... no checking for /root/libresolv.a... no checking for res_init in -lresolv... no checking for t_open in -lxti... no checking for /root/libunp.a... no checking for /root/libunpxti.a... no checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/socket.h... yes checking for sys/time.h... yes checking for time.h... yes checking for netinet/in.h... yes checking for arpa/inet.h... yes checking for errno.h... yes checking for fcntl.h... yes checking for netdb.h... yes checking for signal.h... yes checking for stdio.h... yes checking for stdlib.h... yes checking for string.h... yes checking for sys/stat.h... yes checking for sys/uio.h... yes checking for unistd.h... yes checking for sys/wait.h... yes checking for sys/un.h... yes checking for sys/param.h... yes checking for sys/select.h... yes checking for sys/sysctl.h... yes checking for poll.h... yes checking for sys/event.h... no checking for strings.h... yes checking for sys/ioctl.h... yes checking for sys/filio.h... no checking for sys/sockio.h... no checking for pthread.h... yes checking for net/if_dl.h... no checking for xti.h... no checking for xti_inet.h... no checking for netconfig.h... no checking for netdir.h... no checking for stropts.h... yes checking whether time.h and sys/time.h may both be included... yes checking if uint8_t defined... yes checking if int16_t defined... yes checking if uint16_t defined... yes checking if int32_t defined... yes checking if uint32_t defined... yes checking if size_t defined... yes checking if ssize_t defined... yes checking if socklen_t defined... yes checking if sa_family_t defined... yes checking if t_scalar_t defined... yes checking if t_uscalar_t defined... yes checking for struct sockaddr.sa_len... no checking for struct sockaddr_storage... yes checking for struct sockaddr_storage.ss_family... yes checking for struct msghdr.msg_control... yes checking for struct ifreq.ifr_mtu... yes checking for getaddrinfo function prototype in netdb.h... yes checking for getnameinfo function prototype in netdb.h... yes checking for gethostname function prototype in unistd.h... yes checking for getrusage function prototype in sys/resource.h... yes checking for hstrerror function prototype in netdb.h... yes checking for if_nametoindex function prototype in net/if.h... yes checking for inet_aton function prototype in arpa/inet.h... yes checking for inet_pton function prototype in arpa/inet.h... yes checking for pselect function prototype in sys/select.h... yes checking for snprintf function prototype in stdio.h... yes checking for sockatmark function prototype in sys/socket.h... yes checking for struct addrinfo... yes checking for struct if_nameindex... yes checking for struct sockaddr_dl... no checking for struct timespec... yes checking for /dev/tcp... no checking for /dev/xti/tcp... no checking for /dev/streams/xtiso/tcp... no checking for bzero... yes checking for getaddrinfo... yes checking for gethostname... yes checking for gethostbyname2... yes checking for gethostbyname_r... yes checking for getnameinfo... yes checking for hstrerror... yes checking for if_nametoindex... yes checking for inet_aton... yes checking for inet_pton... yes checking for inet6_rth_init... yes checking for kqueue... no checking for kevent... no checking for mkstemp... yes checking for poll... yes checking for pselect... yes checking for snprintf... yes checking for sockatmark... yes checking for vsnprintf... yes checking for IPv4 support... yes checking for IPv6 support... yes checking for Unix domain sockets... yes checking for multicast support... yes checking for -I/root/doc/unp2ev1/src/include... no configure: creating ./config.status config.status: creating Makefile config.status: creating Make.defines config.status: creating config.h