|
|
main.cpp: In function ‘int main()’: main.cpp:19: error: no matching function for call to ‘Child::func1()’ main.cpp:13: note: candidates are: virtual void Child::func1(int) |
void func1(int bla)
obj.func1();
void func1(int bla)
obj.func1();
I want Parent::func1() being inherited to Child. Calling Child::func1() should call Parent::func1(). Why doesn't this work when func1() is overloaded with a virtual function? |
|
|
am I the only one that noticed that his function signature was void func1(int bla) and the code he was trying to compile was using obj.func1(); The compiler was telling him it needed a parameter, and not that it was having a problem doing function lookup. |