| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 684 人关注过本帖
标题:该程序编译失败
取消只看楼主 加入收藏
ds15fkcjj
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2012-12-8
结帖率:37.5%
收藏
已结贴  问题点数:2 回复次数:2 
该程序编译失败
如下程序用破解版VC6编译失败。
#include<stdio.h>
#include<winsock2.h>
#include<fstream>
#include<iostream>
using namespace sd;
void main()
{
int Client;
int Client2;
fstream Client2;
ofstream Client2;
Client2.open("clienthost.cfg");
Client2>>Client;
Client2.Close
SOCKET Sender;
InitWinsock();
struck sockaddr_in server;
int len =sizeof(server);
server.sin_family=AF_INET;
server.sin_port=htons(1037);
server.sin_addr.s_addr=inet_addr(%d,&Client);
Sender=socket(AF_INET,SOCK_DGRAM,0);
while(1)
printf("请输入要发送的数据,回车后将数据发送到 %d 计算机中。若要调出输入法,请同时按下Ctrl+空格键,或按下Ctrl+Shift。",&Client);
scanf("%s",buffer);
if(sendto(Sender,buffer,sizeof,buffer,0,(struct sockaddr*)&server,len)!=SOCKET_ERROR)
{
printf("发送成功!");
if(recvform(Sender,buffer,sizeofbuffer,0,(struct,sockaddr*)&server,&len)!=SOCKET_ERROR)
msgbox(NULL,buffer,"来自远程计算机发送的消息",MB_OK);
}
}
closesocket(socket1);
}
int Error;
WORD VersionRequested;
WSADATA Wsadata;
VersionRequested=MAKEWORD(2,2);
Error=WSAStartup(VersionRequested,&Wsadata);
if(Error!=0)
{
return FALSE;
}
else
{
if(LOBYTE=(Wsadata.wVersion)!=2||HIBYTE(Wsadata.wHighVersion)!=2)
{
WSACleanup();
return FALSE;
}
}
return TRUE;
}
搜索更多相关主题的帖子: 破解版 server include 1037 
2012-12-12 22:27
ds15fkcjj
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2012-12-8
收藏
得分:0 
#include<stdio.h>
#include<winsock2.h>
#include<fstream>  //文件处理头文件
#include<iostream>  //文件处理头文件
using namespace sd;
void main()
{
int Client;
int Client2;
fstream Client2;
ofstream Client2;
Client2.open("clienthost.cfg"); //读文件clienthost.cfg
Client2>>Client; //读文件到Client变量中,该变量为IP地址
Client2.Close  //关闭文件读取
SOCKET Sender;
InitWinsock();
struck sockaddr_in server;
int len =sizeof(server);
server.sin_family=AF_INET;
server.sin_port=htons(1037);
server.sin_addr.s_addr=inet_addr(%d,&Client);
Sender=socket(AF_INET,SOCK_DGRAM,0);
while(1)
printf("请输入要发送的数据,回车后将数据发送到 %d 计算机中。若要调出输入法,请同时按下Ctrl+空格键,或按下Ctrl+Shift。",&Client);
scanf("%s",buffer);  
if(sendto(Sender,buffer,sizeof,buffer,0,(struct sockaddr*)&server,len)!=SOCKET_ERROR)
{
printf("发送成功!");
if(recvform(Sender,buffer,sizeofbuffer,0,(struct,sockaddr*)&server,&len)!=SOCKET_ERROR)
msgbox(NULL,buffer,"来自远程计算机发送的消息",MB_OK); //对话框
}
}
closesocket(socket1);
}
int Error;
WORD VersionRequested;
WSADATA Wsadata;
VersionRequested=MAKEWORD(2,2);
Error=WSAStartup(VersionRequested,&Wsadata);
if(Error!=0)
{
return FALSE;
}
else
{
if(LOBYTE=(Wsadata.wVersion)!=2||HIBYTE(Wsadata.wHighVersion)!=2)
{
WSACleanup();
return FALSE;
}
}
return TRUE;
}
按照书上的UDPSOCKET示例代码来写的,不同之处在于添加了文件读取功能。
2012-12-12 22:34
ds15fkcjj
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2012-12-8
收藏
得分:0 
错误信息:
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: Clients - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP12.tmp" with contents
[
/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Debug/Clients.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
"C:\Documents and Settings\Administrator\My Documents\CJJ\Clients\Clients.c"
]
Creating command line "cl.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP12.tmp"
Creating temporary file "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP13.tmp" with contents
[
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/Clients.pdb" /debug /machine:I386 /out:"Debug/Clients.exe" /pdbtype:sept
".\Debug\Clients.obj"
]
Creating command line "link.exe @C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\RSP13.tmp"
<h3>Output Window</h3>
Compiling...
Clients.c
c:\documents and settings\administrator\my documents\vc6.0 完整绿色版\vc98\include\eh.h(32) : fatal error C1189: #error :  "eh.h is only for C++!"
执行 cl.exe 时出错.



<h3>Results</h3>
Clients.exe - 1 error(s), 0 warning(s)
</pre>
</body>
</html>
2012-12-13 15:56
快速回复:该程序编译失败
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015922 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved