首页 > 代码库 > 错误之unresolved external symbol

错误之unresolved external symbol

1>WinMain.obj : error LNK2019: unresolved external symbol __imp__DispatchMessageW@4 referenced in function _WinMain@162>WinMain.obj : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _WinMain@163>WinMain.obj : error LNK2019: unresolved external symbol __imp__GetMessageW@16 referenced in function _WinMain@164>WinMain.obj : error LNK2019: unresolved external symbol __imp__UpdateWindow@4 referenced in function _WinMain@165>WinMain.obj : error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function _WinMain@16

错误在linker中 加入依赖项,解决办法是在程序头加入两行:

#pragma comment(lib,"user32.lib")#pragma comment(lib,"gdi32.lib")