Hi,
I'm using Visual Studio 2003 at the moment and I have a few of these inline functions within a C++ class:
inline C3DModel* GameObject::getModel()
{
return &mModel
}
I have set the flag /Ob1 so that the compiler would expand inline functions however when it comes to linking, the compiler complains that it can't find the inline functions:
app.obj : error LNK2019: unresolved external symbol "public: class C3DModel * __thiscall GameObject::getModel(void)" (?getModel@GameObject@@QAEPAVC3DModel@@XZ) referenced in function "void __cdecl DrawModel(class GameObject *)" (?DrawModel@@YAXPAVGameObject@@@Z)
Release/assign2.exe : fatal error LNK1120: 1 unresolved externals
The way I get around this is by defining the inline function within the class declaration but does anybody know what I did wrong when I try to use the inline keyword? Thanks.