免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1870 | 回复: 0
打印 上一主题 下一主题

[C] 头文件找不到的问题,求助 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-11-01 01:44 |只看该作者 |倒序浏览

问题初步描述,加了c99标准后找不到头文件netdb.h里面的内容。

编码如下:
http://cs.ecs.baylor.edu/~donaho ... kets2/textcode.html里面的
Practical.h
DieWithMessage.c
TCPEchoServer4.c
TCPServerUtility.c
AddressUtility.c
编译的时候提示不是C99标准。需要加入 -std c99 或-std gnu99

如果加了就报错

Practical.h:9:6: note: expected ‘const char *’ but argument is of type ‘int’
TCPServerUtility.c:25:67: error: dereferencing pointer to incomplete type
TCPServerUtility.c:27:27: error: dereferencing pointer to incomplete type
TCPServerUtility.c:27:44: error: dereferencing pointer to incomplete type
TCPServerUtility.c:28:13: error: dereferencing pointer to incomplete type
TCPServerUtility.c:33:29: error: dereferencing pointer to incomplete type
TCPServerUtility.c:33:44: error: dereferencing pointer to incomplete type


如果打开eclipse显示



通过ctrl+鼠标左键发现是netdb.h头文件里面的内容识别不了了。

里面c99用的是

TCPServerUtility.c 里面的netdb.h 内容。比如AI_PASSIVE 和 addrinfo结构体
我把for里面的c99标准改写后正常。

不知道这个是为啥。求助。

把里面头文件的内容复制到back.h也不行。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP