Hi guys,
I was trying to use inline function and i put inline function definition in .cpp file
by using inline keyword like below..
class SomeApp
{
private:
SomeApp()
{
}
public:
returnType_t SomeState();
};
inline returnType_t SomeApp::SomeState()
{
code lne 1...
}
I was trying to access SomeState function in another file say fileSubscriber.cpp
My SomeApp class is singleton i didn't put my getInstance code here.
Someapp::GetInstance().SomeState();
It compiles but it gives linking error
fileSubscriber.cpp:136: undefined reference to `SomeApp::SomeState()`
Now if i put my inline function in SomeApp.hpp it does not give linking error. So is something wrong with inline function to be put in .cpp file or i am missing something.
Thanks