4 回答
In your cpp file you need one more line:
ffunct Class::myfunct = NULL;
The class declaration said that the variable would exist somewhere but you never gave it a definition. Since it's not part of each object it has to be defined separately.
Your prototype of doSomething
has a return type of double
, but your implementation thereof has a return type of void
.
static double doSomething(...)
...
void Class::doSomething(...)
Fixing this won't clear all the errors however. You still have a few more as the other answers mention.
static ffunct myfunct;
is a declaration
You need a definition of it also in the cpp file
ffunct Class::myfunct;
add one line on the top of your .cpp file:
ffunct Class::myfunct=NULL;