Microsoft TCP SDK sample的编译问题
系统:DOS 6.22
编译工具: Borland C 3.0
被编译程序:MSTCPSDK DOS Sample client.c
下载地址:http://download.csdn.net/detail/silentwins/4935568
故事背景:楼主接手了一个程序,程序在楼主的环境下正常运行,还能跟服务器端程序通讯(证明楼主的网络驱动配置没有错误)。楼主要对这个程序进行一点小小的扩展,可是拿源码一编译,出错。问对方是如何编译的,由于时间太久远,稳定性还好,所以对方也很久没碰这个程序,记得也不太清楚了。后来发现SDK里面有Sample,就企图编译一下,发现编译Sample的错误跟楼主编译程序的几乎一样。现在楼主企图以编译Sample为目标,希望大家予以帮助!
楼主的编译过程:
1.复制源代码中的MSTCPSDK\INCLUDE和MSTCPSDK\LIB里面的文件拷贝到DOS系统中的C:\BORLANDC\INCLUDE和Z:\BORLANDC\LIB里
2.复制MSTCPSDK\DSAMPLE到DOS系统的C:\
3.CD C:\DSAMPLE
4.BCC client.c
输出结果:
Borland C++ Version 3.1 Copyright (c) 1992 Borland International
client.c:
Warning client.c 89: Call to function 'sleep' with no prototype in function main
Warning client.c 135: Function should return a value in function main
Warning client.c 137: Undefined structure 'servent'
Warning client.c 137: Undefined structure 'protoent'
Warning client.c 137: Undefined structure 'netent'
Warning client.c 137: Undefined structure 'hostent'
Turbo Link Version 5.1 Copyright (c) 1992 Borland International
Error: Undefined symbol __close_socket in module client.c
Error: Undefined symbol __recv in module client.c
Error: Undefined symbol __send in module client.c
Error: Undefined symbol __connect in module client.c
Error: Undefined symbol _inet_addr in module client.c
Error: Undefined symbol _htons in module client.c
Error: Undefined symbol __socket in module client.c
Available memory 3793056