win32 application

Error 1 error LNK2019: unresolved external symbol _MAPIFreeBuffer@4 referenced in function "public: virtual long __stdcall CMailRuleClient::ProcessMessage(struct IMsgStore *,unsigned long,struct ENTRYID *,unsigned long,struct ENTRYID *,unsigned long *,enum _MRCHANDLED *)" ( ProcessMessage@CMailRuleClient@@UAGJPAUIMsgStore@@KPAUENTRYID@@K1PAKPAW4_MRCHANDLED@@@Z) mapirule2.obj

I get this error when I build my project.

Can you help me what is the problem I tried to change some settings about linker but nothing changed.

thanks.




Answer this question

win32 application

  • nhanson

    Please take note that the different version of .OBJ files can cause a liker error.

  • Rajasekhar

    MAPIFreeBuffer() function header is mapix.h, but the function code is contained in cemapi.lib. You have to link your project with this lib, otherwise you'll get the described linker error. If you are using VS, go to your project properties/linker/input and put the lib name in Additional Dependencies line. IMHO you will need some CE SDK or something like this, because cemapi.lib is not included in the Windows SDK.


    As for the _CLSID_MapiRuleSample error, I guess this is your own identifier and you maybe forgot to add some cpp file to your project.

  • sg60

    I also have another error too:

    Error 1 error LNK2001: unresolved external symbol _CLSID_MapiRuleSample mapirule2.obj

    this is also unresolved symbol error

    thanks again



  • Victor DelPrete

    You should write a wrapped class in order to migrate your code into the managed code. This solution can makes your code compatible with the latest VS IDE, I guess.

    A native function call may encounters some errors in the latest VS, the whitepaper I recieved says that it is better to write a managed code and try building your project again.



  • win32 application