Everything is there and looks good to the eye, atleast for a novice like me.
The linker doesn't lie. You are missing that implementation that the linker is looking for.The key word is implementation. Just a declaration is not enough.
As to "your eye" -- does everything look good in this example?
Code:
void foo();
int main()
{
foo();
}
This compiles, but the linker will give you the exact same error. So what is missing here? It is the implementation of the foo() function.
Even though you see a declaration of foo(), all that declaration does is make the compiler happy when you call the function. It is the linker that now needs to know where the "guts" of foo() exists. It isn't found, so the linker gives you an error.
This in a nutshell is what the linker is telling you. Also since C++ allows function overloading, possibly you believe you've implemented your operator function, but you didn't really implement it.
Again, this compiles, and it looks like it should work, but look which foo() you're calling -- you're calling the one that takes an int argument, and that version of foo(int) was not implemented. Only the no-argument of foo was implemented.
So either you never implemented them, or you didn't compile the module(s) where the implementations exist (and give these modules to the linker via your project).
Regards,
Paul McKenzie
Last edited by Paul McKenzie; February 14th, 2012 at 03:47 AM.
The linker doesn't lie. You are missing that implementation that the linker is looking for.The key word is implementation. Just a declaration is not enough.
As to "your eye" -- does everything look good in this example?
Code:
void foo();
int main()
{
foo();
}
This compiles, but the linker will give you the exact same error. So what is missing here? It is the implementation of the foo() function.
Even though you see a declaration of foo(), all that declaration does is make the compiler happy when you call the function. It is the linker that now needs to know where the "guts" of foo() exists. It isn't found, so the linker gives you an error.
This in a nutshell is what the linker is telling you. Also since C++ allows function overloading, possibly you believe you've implemented your operator function, but you didn't really implement it.
Again, this compiles, and it looks like it should work, but look which foo() you're calling -- you're calling the one that takes an int argument, and that version of foo(int) was not implemented. Only the no-argument of foo was implemented.
So either you never implemented them, or you didn't compile the module(s) where the implementations exist (and give these modules to the linker via your project).
Regards,
Paul McKenzie
Just finished thanks to you!!! thank you so much, your advice really helped! 6:35 A.M time for zZzZ
Bookmarks