error LNK2019 in eVC++
-
Hi, Recently I have been working on this server-client side application, using single doc with Doc/View. In fact, I am using the sample eVC++ application called chatter. I only added this code below-> void CVoiceRecorder::OnVoiceRecorder() { // TODO: Add your command handler code here CM_VOICE_RECORDER cmvr; memset( &(cmvr), 0, sizeof(cmvr)); cmvr.cb = sizeof (CM_VOICE_RECORDER); cmvr.dwStyle = VRS_NO_MOVE; cmvr.xPos = -1; //-1 means control is drawn centered to Parent window hwndMain cmvr.yPos = -1; cmvr.hwndParent = m_hWnd; cmvr.id = NULL; cmvr.lpszRecordFileName = TEXT("\\My Documents\\TestRec.wav"); DeleteFile(L"\\My Docuemnts\\TestRec.wav"); DeleteFile(L"\\My Documents\\~Rec_0.wav"); HWND hwndVoice = VoiceRecorder_Create (&cmvr); ::ShowWindow(hwndVoice, WS_VISIBLE); ::UpdateWindow(hwndVoice); } I am trying to display the voice recorder control, but Embedded VC++ gave me this error-> "CVoiceRecorder.obj : error LNK2019: unresolved external symbol _VoiceRecorder_Create referenced in function "protected: void __thiscall CVoiceRecorder::OnVoiceRecorder(void)" (?OnVoiceRecorder@CVoiceRecorder@@IAEXXZ)" What might it be? Thanks. :eek: X| :((:confused:
-
Hi, Recently I have been working on this server-client side application, using single doc with Doc/View. In fact, I am using the sample eVC++ application called chatter. I only added this code below-> void CVoiceRecorder::OnVoiceRecorder() { // TODO: Add your command handler code here CM_VOICE_RECORDER cmvr; memset( &(cmvr), 0, sizeof(cmvr)); cmvr.cb = sizeof (CM_VOICE_RECORDER); cmvr.dwStyle = VRS_NO_MOVE; cmvr.xPos = -1; //-1 means control is drawn centered to Parent window hwndMain cmvr.yPos = -1; cmvr.hwndParent = m_hWnd; cmvr.id = NULL; cmvr.lpszRecordFileName = TEXT("\\My Documents\\TestRec.wav"); DeleteFile(L"\\My Docuemnts\\TestRec.wav"); DeleteFile(L"\\My Documents\\~Rec_0.wav"); HWND hwndVoice = VoiceRecorder_Create (&cmvr); ::ShowWindow(hwndVoice, WS_VISIBLE); ::UpdateWindow(hwndVoice); } I am trying to display the voice recorder control, but Embedded VC++ gave me this error-> "CVoiceRecorder.obj : error LNK2019: unresolved external symbol _VoiceRecorder_Create referenced in function "protected: void __thiscall CVoiceRecorder::OnVoiceRecorder(void)" (?OnVoiceRecorder@CVoiceRecorder@@IAEXXZ)" What might it be? Thanks. :eek: X| :((:confused:
BUG: LNK2019 When Building For Pocket PC Emulation
SYMPTOMS
When building an application for Pocket PC emulation that uses the Windows CE operating system functions, errors similar to the following may be encountered:
<filename>.obj : error LNK2019: unresolved external symbol _CeDeleteDatabase referenced in function <function>
CAUSE
These operating system functions use the _stdcall calling convention, but the compiler is declaring them as _cdecl. This problem occurs with the Windows CE Platform SDK for Pocket PC because the functions are incorrectly declared in the Windbase.h file without a linkage type.
RESOLUTION
Use one of the following workarounds:
- Add the /Gz compiler switch to the configuration's project settings when building for Pocket PC emulation.
-or-
-
If the first workaround prevents other functions/libraries from linking in your project, then modify the Windows CE database function declarations in the Windbase.h file. For example, for the error in the "Symptoms" section, change the following declaration
BOOL CeDeleteDatabase (CEOID oid);
to read:
BOOL WINAPI CeDeleteDatabase (CEOID oid);
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
Raphael Amorim Dantas Leite VC++, VB, Java, .NET and eMbedded Programmer