为什么link 出现警告呢?
警告如下
[Linker Warning] Public symbol '_ErrorMsgTable' defined in both module C:\CBUILDER6\PROJECTS\222\UNIT1.OBJ and C:\CBUILDER6\PROJECTS\222\UNIT2.OBJ
我写了一个测试用例
1.建立一个pub.h文件,内容如下
我是这样做的
1.建立2个窗体,unit1和unit2.
2.unit1.h中#include "pub.h" ,并在一个函数中这样使用, ErrorMsgTable[0].RetCode="111";
3.在unit2.cpp中包含unit1.h和unit2.h
然后编译,会出现上面的link 警告,为什么会重复呢?我不是在pub.h中使用了#ifndef __Pub__
#define __Pub__ 。。。这样的结构吗?应该不会重复的编译了啊?
[Linker Warning] Public symbol '_ErrorMsgTable' defined in both module C:\CBUILDER6\PROJECTS\222\UNIT1.OBJ and C:\CBUILDER6\PROJECTS\222\UNIT2.OBJ
我写了一个测试用例
1.建立一个pub.h文件,内容如下
#ifndef __Pub__
#define __Pub__
typedef struct
{
char *RetCode;
char *ErrorMsg;
} Error_Msg_Table;
Error_Msg_Table ErrorMsgTable[] =
{
{
"111", "错误哦"
}
};
#endif
我是这样做的
1.建立2个窗体,unit1和unit2.
2.unit1.h中#include "pub.h" ,并在一个函数中这样使用, ErrorMsgTable[0].RetCode="111";
3.在unit2.cpp中包含unit1.h和unit2.h
然后编译,会出现上面的link 警告,为什么会重复呢?我不是在pub.h中使用了#ifndef __Pub__
#define __Pub__ 。。。这样的结构吗?应该不会重复的编译了啊?
...全文
相关推荐
修复 j_link is defective 警告.rar
解决J-Link弹出The connected J-Link is defective报错的,Segger的包 直接替换3个文件就行
在警告日志中过滤db_link的方法
在警告日志中过滤db_link的方法 ——由于本人平时也会下载一些资源,所以非常抱歉对该资源收取C币,还望理解。
SIMATIC ET 200SP 通信模块 IO-Link 主站 CM 4xIO-Link[手册].pdf
SIMATIC ET 200SP 通信模块 IO-Link 主站 CM 4xIO-Link[手册]pdf,
FANUC LINK 连接手册
FANUC SERVO AMPLIFIER βi series I/O Link Option MAINTENANCE MANUAL
Fuji MICREX-SX SPH P-link module/PE-link module.pdf
Fuji MICREX-SX SPH P-link module/PE-link modulepdf,Fuji MICREX-SX SPH P-link module/PE-link module


