关于unix网络编程的一点小问题

qdisheng 2012-08-05 05:46:57
最近在看UNIX网络编程,在linux下实现遇到了一些小麻烦,希望各位前辈多多指点。
编译第一个程序时unp.h总是出现问题,我的unp.h是网上常用的一个版本,然后将它和config.h都放在unp这个目录下,然后建一个子目录放我的程序daytimetcpcli.c,一些修改都是按网上改过了,但编译的时候还是出现问题。
如下。
../unp.h:174: warning: "HAVE_STRUCT_SOCKADDR_STORAGE" redefined
.././config.h:185: note: this is the location of the previous definition
../unp.h:204: error: expected specifier-qualifier-list before ‘typedef’
../unp.h:1: error: unterminated #ifndef

不知道怎么回事,求指教。
...全文
131 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
sundayX 2012-08-05
  • 打赏
  • 举报
回复
../unp.h:174: warning: "HAVE_STRUCT_SOCKADDR_STORAGE" redefined
重复定义了,在unp.h中查找HAVE_STRUCT_SOCKADDR_STORAGE,然后注视掉
.././config.h:185: note: this is the location of the previous definition
你的unp.h和config.h都在目录unp中,在unp.h中是#include "./config.h"这样包含的,修改为 #include "config.h"
../unp.h:204: error: expected specifier-qualifier-list before ‘typedef’
不明,无法判断。
../unp.h:1: error: unterminated #ifndef
结尾少了#endif,或者删错了导致#endif出现了不匹配情况

23,116

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧