是这样的,我在类GALinearScaling.h中没有包含GAPopulation.h,只是声明class GAPopulation,因为GALinearScaling类有一个成员函数evaluate的参数为const GAPopulation.而在GAPopulation.h中包含了GAScaling.h,因为有很多地方都要用到GALinearScaling的成员函数。我是参考别人的程序这样做的。
但是编译连接时VC告诉我有以下错误:
GAPopulation.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall GALinearScaling::evaluate(class GAPopulation const &)" (?evaluate@GALinearScaling@@UAEXABVGAPopulation@@@Z)
我应该怎么修改呢?
但是编译连接时VC告诉我有以下错误:
GAPopulation.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall GALinearScaling::evaluate(class GAPopulation const &)" (?evaluate@GALinearScaling@@UAEXABVGAPopulation@@@Z)
我应该怎么修改呢?
而在GAPopulation.h以及GAPopulation.cpp中都包含了GALinearScaling.h,因为有很多地方要用到GALinearScaling的成员函数。
然后编译连接就出现了上面的错误。
其实就是两个类之间互相引用。
怎么修改呢?
我试了,不行
我已经调了好几天了,总是不行。快急死了。
谢谢!
我的:[email protected]