对话框程式.
是这样的:
我在SocketSend类中引用了myh.h头文件,然后又在prcess类中也引用了myh.h.
编译可以通过,但link时出现如下错误.
--------------------Configuration: MyClient - Win32 Release--------------------
Compiling...
MyClient.cpp
MyClientDlg.cpp
Generating Code...
Linking...
SocketSend.obj : error LNK2005: "struct probebuff gProbeBuff1" (?gProbeBuff1@@3Uprobebuff@@A) already defined in process.obj
SocketSend.obj : error LNK2005: "struct probebuff gProbeBuff2" (?gProbeBuff2@@3Uprobebuff@@A) already defined in process.obj
SocketSend.obj : error LNK2005: "struct _RTL_CRITICAL_SECTION gCriticalSectionForBuff" (?gCriticalSectionForBuff@@3U_RTL_CRITICAL_SECTION@@A) already defined in process.obj
SocketSend.obj : error LNK2005: "struct _RTL_CRITICAL_SECTION gCriticalSectionForPrtBuff" (?gCriticalSectionForPrtBuff@@3U_RTL_CRITICAL_SECTION@@A) already defined in process.obj
SocketSend.obj : error LNK2005: "struct probebuff * PtrBuffWrite" (?PtrBuffWrite@@3PAUprobebuff@@A) already defined in process.obj
是这样的:
我在SocketSend类中引用了myh.h头文件,然后又在prcess类中也引用了myh.h.
编译可以通过,但link时出现如下错误.
--------------------Configuration: MyClient - Win32 Release--------------------
Compiling...
MyClient.cpp
MyClientDlg.cpp
Generating Code...
Linking...
SocketSend.obj : error LNK2005: "struct probebuff gProbeBuff1" (?gProbeBuff1@@3Uprobebuff@@A) already defined in process.obj
SocketSend.obj : error LNK2005: "struct probebuff gProbeBuff2" (?gProbeBuff2@@3Uprobebuff@@A) already defined in process.obj
SocketSend.obj : error LNK2005: "struct _RTL_CRITICAL_SECTION gCriticalSectionForBuff" (?gCriticalSectionForBuff@@3U_RTL_CRITICAL_SECTION@@A) already defined in process.obj
SocketSend.obj : error LNK2005: "struct _RTL_CRITICAL_SECTION gCriticalSectionForPrtBuff" (?gCriticalSectionForPrtBuff@@3U_RTL_CRITICAL_SECTION@@A) already defined in process.obj
SocketSend.obj : error LNK2005: "struct probebuff * PtrBuffWrite" (?PtrBuffWrite@@3PAUprobebuff@@A) already defined in process.obj
解决方案 »
- 菜鸟问题:VARIANT到底是个啥?
- 请教一个问题IHTMLDocument2
- 200分问问下面的代码是什么意思?之100分之一
- 请高手帮忙。
- 一个问题:CSocket中我用Send发送数据(TCP),接收以后我怎么把它们分开?
- MSXML2怎么循环把4个节点的内容分别放在一个四维的数组内?
- 处理一张24位的彩色图像,程序运行后图像压缩显示了,请教各位
- 急!!!!!!class view中看不见view类
- 关于vc++游戏编程方面的书,介绍几本
- 求教Windows sensor API的问题????
- 如何用vc将网站上的网页(html or xml )读入到一块内存中。
- 关于动态创建控件的消息处理问题!
#ifndef xxxx
#include "xx.h"
#define xxxx
#endif
#if !defined(MYH)
#define MYH#include"string"struct probebuff
{
std::string str;
int len;
};typedef struct
{
char szType[25];
char ipaddr[12];
int recpacket;
int sentpacket;
int port;
} SendParam;struct Mail
{
unsigned short port;
char from[100];
char to[100];
char subject[100];
char attachment[100];
int from_flag;
int to_flag;
int subject_flag;
int attachment_flag;
int finish;
struct Mail *next;
} ;probebuff gProbeBuff1;
probebuff gProbeBuff2;
CRITICAL_SECTION gCriticalSectionForBuff;
CRITICAL_SECTION gCriticalSectionForPrtBuff;
probebuff * PtrBuffWrite;
#endif