LNK2019 error about CeMountDBVolEx and CeOpenDatabaseInSession!!Anyone can help me?

hi everyone!
    i wrote a simple program use studio2005 with WM5.0PPC platform. i want to read some contact information from the SimEntries database use some APIs as CeMountDBVolEx and CeOpenDatabaseInSession. i find the API descriptions in msdn. it must include Windbase.h and link the Coredll.lib to use it. i include Windbase.h,then build ,it said CeMountDBVolEx and CeOpenDatabaseInSession not defined. i look the Windbase.h, CeMountDBVolEx and CeOpenDatabaseInSession was not decleared in it . i search some head file ,in Windbase_edb.h,i found them,then i include Windbase_edb.h,build ,it said LNK2019 error with the two funcs,i add the Coredll.lib in the Linker' input tab,so what can i do thanks for your help!!


Answer this question

LNK2019 error about CeMountDBVolEx and CeOpenDatabaseInSession!!Anyone can help me?

  • Clifford Grimm

    I am having the same problem with a different project and I don't know what I should do to fix it.  I am very much a novice at this, so bear with me a little.  I am using Microsoft's eMbedded Visual C++ v 4.00 to compile a cpp.

    The linker is giving me errors with some __cdecl though it is not defined anywhere.  I have read online that it has something to do with stdcall but I cannot fix it.

     hepower wrote:
    Hi Gangahar,Thanks for your reply.
    I check my project,the project->properties->C/C++->Language->"Treate wchar_t as build in type" switch is yes,when i set it to no ,i build it ,return more link error include the two i have mentioned.

    thanks again,what else can i do


    I cannot find where this is.  I have searched in the project settings and no such checkbox or item exits.  I have tried putting ccrtrtti.lib in the LIB folder of my SDK (STANDARDSDK_420) and putting it into the Object/library modules section of the link settings.  I still get the errors.

    Any help

    My error messages, I've added spaces to improve readability:
    Linking...
       Creating library X86Dbg/FSNotify.lib and object X86Dbg/FSNotify.exp

    FSNotify.obj : error LNK2019: unresolved external symbol _FindClosePartition referenced in function "void __cdecl OnMountStorage(struct DEVDETAIL const &,unsigned long)" ( OnMountStorage@@YAXABUDEVDETAIL@@K@Z)

    FSNotify.obj : error LNK2019: unresolved external symbol _FindNextPartition referenced in function "void __cdecl OnMountStorage(struct DEVDETAIL const &,unsigned long)" ( OnMountStorage@@YAXABUDEVDETAIL@@K@Z)

    FSNotify.obj : error LNK2019: unresolved external symbol _FindFirstPartition referenced in function "void __cdecl OnMountStorage(struct DEVDETAIL const &,unsigned long)" ( OnMountStorage@@YAXABUDEVDETAIL@@K@Z)

    FSNotify.obj : error LNK2019: unresolved external symbol _OpenStore referenced in function "void __cdecl OnMountStorage(struct DEVDETAIL const &,unsigned long)" ( OnMountStorage@@YAXABUDEVDETAIL@@K@Z)

    FSNotify.obj : error LNK2019: unresolved external symbol __imp__PathFileExistsW referenced in function "void __cdecl OnMountedVolume(struct tagPARTINFO const &)" ( OnMountedVolume@@YAXABUtagPARTINFO@@@Z)

    corelibc.lib(pegwmain.obj) : error LNK2019: unresolved external symbol _WinMain referenced in function _WinMainCRTStartup
    X
    86Dbg/FSNotify.exe : fatal error LNK1120: 6 unresolved externals
    Error executing link.exe.

    FSNotify.exe - 7 error(s), 0 warning(s)


  • ff_mac

    Oh,I know how to do with it now.
    Thanks for your help and best wishes to you.

  • vidhyaprakash

    Hi,

    You can find out if the reference function is unmangled C function by looking at its declaration. Just try to do to the declaration of the C function, and you will see that the declaration shows "__cdecl" after the return type in the prototype of that function. The other way is to dump all the exports of the library using the dumpbin command from the vs command prompt on the library. The exports list shows the exact name of the exported function, from the name you can easily make out if it is a mangled name or unmangled name.

    Thanks,
    Gangadhar

  • DLeighty

    Hi,

    I too faced the similar linking errors as follows and many more:

    uafxcw.lib(objcore.obj) : error LNK2019: unresolved external symbol "void __cdecl `eh vector destructor iterator'(void *,unsigned int,int,void (__cdecl*)(void *))" ( _M@YAXPAXIHP6AX0@Z@Z) referenced in function "public: void * __cdecl ATL::CComTypeInfoHolder::stringdispid::`vector deleting destructor'(unsigned int)" ( _Estringdispid@CComTypeInfoHolder@ATL@@QAAPAXI@Z)
    uafxcw.lib(bartool.obj) : error LNK2001: unresolved external symbol "void __cdecl `eh vector destructor iterator'(void *,unsigned int,int,void (__cdecl*)(void *))" ( _M@YAXPAXIHP6AX0@Z@Z)
    uafxcw.lib(wincore.obj) : error LNK2019: unresolved external symbol __RTDynamicCast referenced in function "long __cdecl AfxCallWndProc(class CWnd *,struct HWND__ *,unsigned int,unsigned int,long)" ( AfxCallWndProc@@YAJPAVCWnd@@PAUHWND__@@IIJ@Z)


    Well I'm using GNUMakefile to build my applications using VS2005 tools and tried adding flag /Zc:wchar_t while compiling my .cpp files. But no luck. Finaly I added Ccrtrtti.lib lib file at linking time and all linking errors were resolved.

    Hope this helps.
    -Seemit

  • Smitha S Saligrama

    Hi,Gangadhar

    Thanks for your help ,I have solved my problem as you said.
    but how can you find the library exports all the methods us unmangled C functions

  • Jacek F

    Hi,
    This looks like, either you are missing the lib file in the link options(Project Properties, Linker, Input , Ignore all default Libraries , check if this opt is set to yes, then change it to no ),

    or you are not using a consistent runtime library for all your dependent projects.
    See if you can try this,
    check, Project->Properties->C/C++->Runtime Library, and ensure that all DLLs and exes you have link to same library (for example for a dubug build you use "Multi-threaded Debug DLL (/MDd)") for all your projects.

    Try rebuilding when you change the above said options.

    If this also returns linker error, then you can send me a sample project file that gives this linker errors, I will look into it.

    Thanks,
    Gangadhar

  • Spidey

    Hi Seemit,thanks for your help.
    I have downloaded the RITTI.exe and copy the Ccrtrtti.lib and Ccrtrtti.pdb to my WM5.0SDK's lib folder.And add Ccrtrtti.lib support in the project settings.Then build ,return more link error just as i turn the "Treat wchar_t as Built-in Type" switch off.I type it here.

    error LNK2019: unresolved external symbol "public: __cdecl CWinApp::CWinApp(unsigned short const *)" ( 0CWinApp@@QAA@PBG@Z) referenced in function "public: __cdecl CtestOpenSimsDatabaseApp::CtestOpenSimsDatabaseApp(void)" ( 0CtestOpenSimsDatabaseApp@@QAA@XZ)
    testOpenSimsDatabase.obj : error LNK2001: unresolved external symbol "public: virtual class CDocument * __cdecl CWinApp::OpenDocumentFile(unsigned short const *)" ( OpenDocumentFile@CWinApp@@UAAPAVCDocument@@PBG@Z)
    testOpenSimsDatabase.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl CWinApp::DoMessageBox(unsigned short const *,unsigned int,unsigned int)" ( DoMessageBox@CWinApp@@UAAHPBGII@Z)
    testOpenSimsDatabase.obj : error LNK2019: unresolved external symbol "protected: void __cdecl CWinApp::SetRegistryKey(unsigned short const *)" ( SetRegistryKey@CWinApp@@IAAXPBG@Z) referenced in function "public: virtual int __cdecl CtestOpenSimsDatabaseApp::InitInstance(void)" ( InitInstance@CtestOpenSimsDatabaseApp@@UAAHXZ)
    testOpenSimsDatabaseDlg.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl CWnd::Create(unsigned short const *,unsigned short const *,unsigned long,struct tagRECT const &,class CWnd *,unsigned int,struct CCreateContext *)" ( Create@CWnd@@UAAHPBG0KABUtagRECT@@PAV1@IPAUCCreateContext@@@Z)
    testOpenSimsDatabaseDlg.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl CWnd::CreateEx(unsigned long,unsigned short const *,unsigned short const *,unsigned long,struct tagRECT const &,class CWnd *,unsigned int,void *)" ( CreateEx@CWnd@@UAAHKPBG0KABUtagRECT@@PAV1@IPAX@Z)
    testOpenSimsDatabaseDlg.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl CWnd::CreateEx(unsigned long,unsigned short const *,unsigned short const *,unsigned long,int,int,int,int,struct HWND__ *,struct HMENU__ *,void *)" ( CreateEx@CWnd@@UAAHKPBG0KHHHHPAUHWND__@@PAUHMENU__@@PAX@Z)
    testOpenSimsDatabaseDlg.obj : error LNK2001: unresolved external symbol "public: virtual int __cdecl CDialog::Create(unsigned short const *,class CWnd *)" ( Create@CDialog@@UAAHPBGPAVCWnd@@@Z)
    testOpenSimsDatabaseDlg.obj : error LNK2019: unresolved external symbol "int __cdecl CeMountDBVolEx(struct _CEGUID *,unsigned short *,struct _CEVOLUMEOPTIONS *,unsigned long)" ( CeMountDBVolEx@@YAHPAU_CEGUID@@PAGPAU_CEVOLUMEOPTIONS@@K@Z) referenced in function "int __cdecl MountDbVol(void)" ( MountDbVol@@YAHXZ)
    testOpenSimsDatabaseDlg.obj : error LNK2019: unresolved external symbol "void * __cdecl CeOpenDatabaseInSession(void *,struct _CEGUID *,unsigned long *,unsigned short *,struct _SORTORDERSPECEX *,unsigned long,struct _CENOTIFYREQUEST *)" ( CeOpenDatabaseInSession@@YAPAXPAXPAU_CEGUID@@PAKPAGPAU_SORTORDERSPECEX@@KPAU_CENOTIFYREQUEST@@@Z) referenced in function "void * __cdecl OpenDbase(enum EDBASE)" ( OpenDbase@@YAPAXW4EDBASE@@@Z)

    thans for your help.



  • Tayo

    Ha,I made a mistake just now.
    when i add Ccrtrtti.lib support, it also return the two link error as before.
    the more error is caused because i turn the "Treat wchar_t as Build-in Type" switch disabled.so what else can i do



  • pwilliams82

    Hi,
    I have sent you an email to your id as I can see by clicking on your name in this post, pls respond to that with the sample proj.
    Thanks,
    Gangadhar

  • Hennesey

    Hi Wesley,

    Try following these links from my blog posts on vsd team site
    http://blogs.msdn.com/vsdteam/archive/2005/11/16/linker_error_lnk2019_lnk2001.aspx
    and
    http://blogs.msdn.com/vsdteam/archive/2005/11/20.aspx

    both these two links should help you solve your problems, if you still face the problems, let me know.
    Thanks,
    Gangadhar

  • zuninet

    Hi Gangahar,Thanks for your reply.
    I check my project,the project->properties->C/C++->Language->"Treate wchar_t as build in type" switch is yes,when i set it to no ,i build it ,return more link error include the two i have mentioned.

    thanks again,what else can i do

  • Andrew MacNeill

    Hi,

    This is a known issue, For more information on what is causing these linker errors and the suggested work around you can visit, http://blogs.msdn.com/vsdteam/archive/2005/11/16/linker_error_lnk2019_lnk2001.aspx

    Hope this helps.
    Thanks,
    Gangadhar

  • DimD

    Hi,< xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

     

    Thanks for sharing a sample project with me.

    Now I know why you keep getting this linker error. You are including

          #include <windbase_edb.h>

     

    In your “testOpenSimsDatabaseDlg.cpp” file, for functions  CeMountDBVolEx and CeOpenDatabaseInSession from coredll.lib library.

     This library exports all the methods us unmangled C functions. Since you are including it in a CPP file you should change it as below in your “testOpenSimsDatabaseDlg.cpp” file

     

    extern "C"

    {

          #include <windbase_edb.h>

    }

     

    Hope this solved your problem

     

    Thanks,

    Gangadhar


  • Rami Reddy

    I have check my project settings as you suggested.It seems no problem.The sample is just try to open database with some APIs.So could you give me your email address and i will send you my sample.thanks a lot.

  • LNK2019 error about CeMountDBVolEx and CeOpenDatabaseInSession!!Anyone can help me?