阅读:1503回复:6
关于LNK2019的错误求教
我在VC++下面debug里编译程序没有问题,但是在realse里面编译时出现了LNK2019的错误,错误如下:
CDPlayer error LNK2019: unresolved external symbol __imp__mciGetErrorStringA@12 referenced in function "void __cdecl ErrorProc(unsigned long)" (?ErrorProc@@YAXK@Z) CDPlayer error LNK2019: unresolved external symbol __imp__mciSendCommandA@16 referenced in function "public: long __thiscall CPlayer::Open(void)" (?Open@CPlayer@@QAEJXZ) ErrorProc代码如下: void ErrorProc(MCIERROR dwResult) { HANDLE hMem; LPSTR lpStringBuff; hMem=GlobalAlloc(GHND,80); if (hMem) { lpStringBuff=(char *)GlobalLock(hMem); if (lpStringBuff) { if(mciGetErrorString(dwResult,lpStringBuff,80)) MessageBox(NULL,lpStringBuff,"ERROR",MB_OK); else MessageBox(NULL,"Generic Error","ERROR",MB_OK); GlobalUnlock(hMem); } else MessageBox(NULL,"Lock Failed","ERROR",MB_OK); GlobalFree(hMem); } else MessageBox(NULL,"Alloc Failed","ERROR",MB_OK); return ; } |
|
沙发#
发布于:2005-01-18 12:47
这应该是链接库没放到release的link里面
|
|
|
板凳#
发布于:2005-01-18 13:45
肯定是只在Debug设置里加了,忘了Release。
|
|
|
地板#
发布于:2005-01-18 14:34
是winmm.lib没有在release里面加上.谢谢了
|
|
地下室#
发布于:2005-03-01 10:27
#pragma comment(lib ,\"winmm\")
|
|
|
5楼#
发布于:2005-03-01 10:40
#pragma comment(lib ,\"winmm\") 我比较喜欢用这种方法..... |
|
|
6楼#
发布于:2005-03-01 15:43
wowocock还在驱动版里混啊,换工作了没有啊
|
|
|