error LNK2019: unresolved external symbol "public: short __thiscall Sprite::y(void)const " (?y@Sprite@@QBEFXZ) referenced in function _SDL_main
I'm using Visual C++ 2008 EE
This should work, are you sure that the cpp file in which this definition resides is visible (is it included in the project). When you get the unresolved external error that usually means that the linker cannot find the location where the function is defined ( that can happen from a mismatch of the function signature, such as when you define a function as const in declaration and not in definition or vise-versa, so you should check that the signatures are the same ) Hope this helps.
You didn't come into this world. You came out of it, like a wave from the ocean. You are not a stranger here. -Alan Watts
Quote:Original post by SiCrane An inline function must be defined in every translation unit in which it is used. In practice this means that it has to go inside a header file.