日期:2014-05-16  浏览次数:20612 次

unix网络编程unp.h有关问题
从网上下载乐unix网络编程这本书的源代码,然后按readme配置:
./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

  //* 1*// 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
从//* 1 *//开始就配置不了,只到cd ../libfree make这里,另外我运行daytimetcpcli的时候提示找不到unp.h,将其复制到相应文件夹,运行如下:
In file included from daytimetcpcli.h:1:
unp.h:122: error: redefinition of ‘struct in_pktinfo’
请问我要如何解决问题呢?

------解决方案--------------------
不好意思,刚才没看清楚,当成没找到这个结构体了
redefinition of ‘struct in_pktinfo’
这里报的是重定义
参考这个主题吧:
http://topic.csdn.net/u/20090313/11/690d237b-dcd8-498e-b96b-df015d7ae343.html