遇到的链接错误

2010-03-17

Linking...

"int __cdecl ThresholdDIB(char *,long,long)" (?ThresholdDIB@@YAHPADJJ@Z) already defined in globalimage.obj

Debug/lightleakage.exe : fatal error LNK1169: one or more multiply defined symbols found

执行 link.exe 时出错.

原因是:

openwidthmeasure.cpp中定义的某一个函数中,用到了已经在globalimage.cpp中定义的结构体。所以,我的openwidthmeasure.h中include  globalimage.cpp.出现上述情况。

改正:

将结构体,定义到了globalimage.h中,在openwidthmeasure.cpp中include  globalimage.h  解决了以上情况。

你可能感兴趣的:(遇到的链接错误)