Why show the this error message "undefined reference to function error". ?
-
Hello
I've some problem on my qt program.problem :
I want to use myfunc(unsigned char Param1, unsigned char Param2) function in myClass.
This function's location is in another folder.
so, I include the function location path in myClass header file.but, when I build the source, the error message is show like this. "undefined reference to 'myfunc(unsigned char, unsigned char)'
I saw the many kind of solution on google web site, but it still not solve this problem..
Is anybody know the this problem? Why does the problem occur?
-
Hi!
Where is the definition of this function?
Usually a header file only contains a declaration like this:void myfunc(unsigned char Param1, unsigned char Param2);
And then the definition is in a cpp file:
void myfunc(unsigned char Param1, unsigned char Param2) { }
The error message you get says that the definition of that function was not found. You probably forgot to add the cpp file to your project or you do not have the definition at all (its difficult to say as you did not provide enough information).
-
Hi!
Where is the definition of this function?
Usually a header file only contains a declaration like this:void myfunc(unsigned char Param1, unsigned char Param2);
And then the definition is in a cpp file:
void myfunc(unsigned char Param1, unsigned char Param2) { }
The error message you get says that the definition of that function was not found. You probably forgot to add the cpp file to your project or you do not have the definition at all (its difficult to say as you did not provide enough information).