我得到這樣的錯誤:C++類重定義錯誤幫助
FxMathFunctions.h: In function 'FxInt32 IMin(FxInt32, FxInt32)':
FxMathFunctions.h:13: error: redefinition of 'FxInt32 IMin(FxInt32, FxInt32)'
FxMathFunctions.h:15: error: 'FxInt32 IMin(FxInt32, FxInt32)' previously defined here
在FxMathFunctions.h我:
11: struct FxPoint2d;
12:
13: inline FxInt32 IMin(FxInt32 i1,FxInt32 i2)
14: {
15: if (i2 < i1) i1 = i2;
16: return i1;
17: }
FxInt32中,我包括頭定義爲:
typedef long FxInt32;
如果說FxInt32正在被重新定義,或者如果整個功能是我不能被錯誤決定。
我該如何解決這個問題?
UPDATE我在上面添加了行號。
FxMathFunctions.h的第13行和第15行是什麼? – bdonlan 2010-06-23 04:29:53
這很奇怪。看起來行號有點向下移動了一點。 11-12行是什麼? – bdonlan 2010-06-23 04:48:45
@bdonlan - 再次更新 – Elliot 2010-06-23 04:53:03