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. MyMAPIDlg.obj : error LNK2001: unresolved external symbol _MAPIReadMail@24

MyMAPIDlg.obj : error LNK2001: unresolved external symbol _MAPIReadMail@24

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
6 Posts 3 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.
  • D Offline
    D Offline
    Dan Madden
    wrote on last edited by
    #1

    Everything compiles fine except this linker error...can anyone help to clear it?? I have all of the headers included. What am I doing wrong??? Thanks in advance, Dan

    M L 2 Replies Last reply
    0
    • D Dan Madden

      Everything compiles fine except this linker error...can anyone help to clear it?? I have all of the headers included. What am I doing wrong??? Thanks in advance, Dan

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      Add mapi32.lib to the list of import libs in your linker settings. --Mike-- http://home.inreach.com/mdunn/ Is history an illusion caused by the passage of time, or is time an illusion caused by the passage of history?

      D 1 Reply Last reply
      0
      • M Michael Dunn

        Add mapi32.lib to the list of import libs in your linker settings. --Mike-- http://home.inreach.com/mdunn/ Is history an illusion caused by the passage of time, or is time an illusion caused by the passage of history?

        D Offline
        D Offline
        Dan Madden
        wrote on last edited by
        #3

        It is linked! Here is the error view: --------------------Configuration: MyMAPI - Win32 Debug-------------------- Compiling... MyMAPIDlg.cpp E:\Compaq\C++\ATest\MAPI\MyMAPI\MyMAPIDlg.cpp(182) : warning C4101: 'szTmp' : unreferenced local variable Linking... MyMAPIDlg.obj : error LNK2001: unresolved external symbol _MAPIReadMail@24 MyMAPIDlg.obj : error LNK2001: unresolved external symbol _MAPIFindNext@28 Debug/MyMAPI.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. MyMAPI.exe - 3 error(s), 1 warning(s) Thanks in advance, Dan

        M 1 Reply Last reply
        0
        • D Dan Madden

          It is linked! Here is the error view: --------------------Configuration: MyMAPI - Win32 Debug-------------------- Compiling... MyMAPIDlg.cpp E:\Compaq\C++\ATest\MAPI\MyMAPI\MyMAPIDlg.cpp(182) : warning C4101: 'szTmp' : unreferenced local variable Linking... MyMAPIDlg.obj : error LNK2001: unresolved external symbol _MAPIReadMail@24 MyMAPIDlg.obj : error LNK2001: unresolved external symbol _MAPIFindNext@28 Debug/MyMAPI.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. MyMAPI.exe - 3 error(s), 1 warning(s) Thanks in advance, Dan

          M Offline
          M Offline
          Michael Dunn
          wrote on last edited by
          #4

          Huh, this is weird. I searched MSDN for "mapi lnk2001" and found Q188959, which says basically you don't link with an import lib. You instead have to load mapi32.dll and call GetProcAddress() on all MAPI functions you call. --Mike-- http://home.inreach.com/mdunn/ Is history an illusion caused by the passage of time, or is time an illusion caused by the passage of history?

          D 1 Reply Last reply
          0
          • M Michael Dunn

            Huh, this is weird. I searched MSDN for "mapi lnk2001" and found Q188959, which says basically you don't link with an import lib. You instead have to load mapi32.dll and call GetProcAddress() on all MAPI functions you call. --Mike-- http://home.inreach.com/mdunn/ Is history an illusion caused by the passage of time, or is time an illusion caused by the passage of history?

            D Offline
            D Offline
            Dan Madden
            wrote on last edited by
            #5

            Hi Micael, That was it! Thanks for the tip! Thanks in advance, Dan

            1 Reply Last reply
            0
            • D Dan Madden

              Everything compiles fine except this linker error...can anyone help to clear it?? I have all of the headers included. What am I doing wrong??? Thanks in advance, Dan

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              You might be failed to define a function after its declaration. Please check it

              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