error LNK2019 using AFX_MODULE_STATE in Release version
-
hi , i use the following code which works fine in Debug mode. AFX_MODULE_STATE *pstMngSt; pstMngSt = AfxGetStaticModuleState(); AFX_MANAGE_STATE(pstMngSt); AfxSetModuleState(pstMngSt); m_hInstance = pstMngSt->m_hCurrentInstanceHandle; But when i use the same in Release version, i get error LNK2019: unresolved external symbol "public: __thiscall AFX_MAINTAIN_STATE2::~AFX_MAINTAIN_STATE2(void)" (??1AFX_MAINTAIN_STATE2@@QAE@XZ) referenced in function "public: void __thiscall CModeMGMT::DispatchDllMsg(struct HWND__ *,unsigned int,unsigned int,long)" Any library file to be included ?? Pls help me.. Thx Sugu
-
hi , i use the following code which works fine in Debug mode. AFX_MODULE_STATE *pstMngSt; pstMngSt = AfxGetStaticModuleState(); AFX_MANAGE_STATE(pstMngSt); AfxSetModuleState(pstMngSt); m_hInstance = pstMngSt->m_hCurrentInstanceHandle; But when i use the same in Release version, i get error LNK2019: unresolved external symbol "public: __thiscall AFX_MAINTAIN_STATE2::~AFX_MAINTAIN_STATE2(void)" (??1AFX_MAINTAIN_STATE2@@QAE@XZ) referenced in function "public: void __thiscall CModeMGMT::DispatchDllMsg(struct HWND__ *,unsigned int,unsigned int,long)" Any library file to be included ?? Pls help me.. Thx Sugu
The easiest way to solve this problem is to compare the DEBUG settings with the RELEASE settings. You will find that you have additional DEBUG libraries that are missing from the RELEASE settings. Add these to the RELEASE settings and all should be OK. I would advise you clean and rebuild the project (after you have made the changes). Ant. I'm hard, yet soft.
I'm coloured, yet clear.
I'm fruity and sweet.
I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)