|
-
March 24th, 2016, 01:36 AM
#1
error LNK2001: unresolved external symbol
i am using singulton pattern and visual studio 2010. getting this linker error.
error LNK2001: unresolved external symbol "public: static class CAIUInterface * __cdecl CAIUInterface::GetInstance(void)" (? GetInstance@CAIUInterface@@SAPAV1@XZ) D:\15008_CPDS\CPDS\Transmitter.obj CPDS
// this is header file.
class CAIUInterface
{
private:
static bool m_bInstanceFlag; the status of single instance creation.
static CAIUInterface *m_objAIU;
}
// here is function definition.
CAIUInterface* CAIUInterface::GetInstance()
{
///Step1: Check whether instance is created
if (!m_bInstanceFlag)
{
///Step2: If instance is not created, create it newly and update the instance status to true.
m_objAIU = new CAIUInterface();
m_bInstanceFlag = true;
}
///Step3: Return the pointer object or address of CAIUInterface instance.
return m_objAIU;
}
//i am using like following.
int CAppAIUInterface::CloseApp()
{
siResult = CAIUInterface::GetInstance()->Close();
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|