0

我正在做一个包含两个类的项目:证据和图像(证据的儿子)

Evidence 的构造函数是:

Evidence(A* a, B* b, C* c);

继承类Image的构造函数为:

Image(A* a, B* b, C* c): Evidence(a,b,c){... code...}

编译器向我抛出以下错误:

In file included from src/evidence/Image.cpp:8:
src/evidence/Image.h:22: error: no matching function for call to
'Evidence::Evidence(A*&, B*&, C*&)'
src/evidence/Evidence.h:35: note: candidates are: Evidence::Evidence(A*, B*, C*)
src/evidence/Evidence.h:21: note: Evidence::Evidence(const Evidence&)

怎么了?我很困惑,以至于我伤害了自己。

4

1 回答 1

0

声明Evidence构造函数,但实际上并没有定义它。

代替:

Evidence(A* a, B* b, C* c);

和:

Evidence(A* a, B* b, C* c) {}

于 2013-07-01T22:02:04.910 回答