Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. error LNK2019 using AFX_MODULE_STATE in Release version

error LNK2019 using AFX_MODULE_STATE in Release version

Scheduled Pinned Locked Moved C / C++ / MFC
helpannouncementdebuggingquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sugumar
    wrote on last edited by
    #1

    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

    A 1 Reply Last reply
    0
    • S sugumar

      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

      A Offline
      A Offline
      Antony M Kancidrowski
      wrote on last edited by
      #2

      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)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups