免费注册 查看新帖 |

Chinaunix

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

奇怪的问题,identify redeclare tcp_send __LINE__ [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-02-19 09:44 |只看该作者 |倒序浏览
我的头文件:tcp.h
#ifndef _tcp_h
#define _tcp_h
int tcp_send(int sd,void *buf,int len,int timeout);
#endif
我的源文件:tcp.c
#include "tcp.h"
int tcp_send(int sd,void *buf,int len,int timeout);
{
........
}


在sco 505下cc tcp.c -c
系统error:identify redeclare tcp_send in file tcp.c of line 45

我的程序没有在其他地方定义这个tcp_send呀,why呢?

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
2 [报告]
发表于 2004-02-19 09:55 |只看该作者

奇怪的问题,identify redeclare tcp_send __LINE__

把你的程序贴完整了。

论坛徽章:
0
3 [报告]
发表于 2004-02-19 10:14 |只看该作者

奇怪的问题,identify redeclare tcp_send __LINE__

//tcp.h
#ifndef _TCP_H
#define _TCP_H

int tcp_init(void);
int tcp_connect(char *hostname, int port, int max_wait_seconds);
int tcp_bind(int port);
int tcp_accept(int sd, int max_wait_time);
int tcp_recv(int sd, void *buf, int len, int max_wait_seconds);
int tcp_send(int sd, char *buf, int len, int max_wait_seconds);
int tcp_close(int sd);
int tcp_shut(int sd);

#endif

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
4 [报告]
发表于 2004-02-19 10:21 |只看该作者

奇怪的问题,identify redeclare tcp_send __LINE__

int tcp_send(int sd,void *buf,int len,int timeout);
后面怎么有个分号?
是不是笔误?

论坛徽章:
0
5 [报告]
发表于 2004-02-19 10:39 |只看该作者

奇怪的问题,identify redeclare tcp_send __LINE__

没有,我贴上去的笔误!
//tcp.c
#include "tcp.h"

int tcp_init(void){}
int tcp_connect(char *hostname, int port, int ax_wait_seconds){}
int tcp_bind(int port){}
int tcp_accept(int sd, int max_wait_time){}
int tcp_recv(int sd, void *buf, int len, int max_wait_seconds){}
int tcp_send(int sd, char *buf, int len, int max_wait_seconds){}
int tcp_close(int sd){}
int tcp_shut(int sd){}

论坛徽章:
0
6 [报告]
发表于 2004-02-19 10:41 |只看该作者

奇怪的问题,identify redeclare tcp_send __LINE__

而且我只要把两个文件中的tcp_send该成不一样,就没问题

奇怪的是其他的函数没有问题?

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
7 [报告]
发表于 2004-02-19 10:42 |只看该作者

奇怪的问题,identify redeclare tcp_send __LINE__

这个是你完整的程序吗?

论坛徽章:
0
8 [报告]
发表于 2004-02-19 10:58 |只看该作者

奇怪的问题,identify redeclare tcp_send __LINE__

我就是这么编译,都报tcp_send identify redeclare !

论坛徽章:
0
9 [报告]
发表于 2004-02-19 11:01 |只看该作者

奇怪的问题,identify redeclare tcp_send __LINE__

lenovo:
你在你的编译环境试一下,如果没有问题,就是我的sco由问题了!先谢了!

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
10 [报告]
发表于 2004-02-19 11:04 |只看该作者

奇怪的问题,identify redeclare tcp_send __LINE__

我在aix5l下,gcc编译,没问题。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP