我知道是vc++设置的问题,改怎么设置error LNK2001: unresolved external symbol __imp__DispatchMessageA@4
WinMain.obj : error LNK2001: unresolved external symbol __imp__TranslateMessage@4
WinMain.obj : error LNK2001: unresolved external symbol __imp__GetMessageA@16
WinMain.obj : error LNK2001: unresolved external symbol __imp__ShowWindow@8
WinMain.obj : error LNK2001: unresolved external symbol __imp__CreateWindowExA@48
WinMain.obj : error LNK2001: unresolved external symbol __imp__LoadIconA@8
WinMain.obj : error LNK2001: unresolved external symbol __imp__LoadCursorA@8
WinMain.obj : error LNK2001: unresolved external symbol __imp__GetStockObject@4
WinMain.obj : error LNK2001: unresolved external symbol __imp__DefWindowProcA@16
WinMain.obj : error LNK2001: unresolved external symbol __imp__MessageBoxA@16

解决方案 »

  1.   

    我用windows的API写了个简单的窗口程序,建的工程是win32 application
      

  2.   

    可能有些API需要lib文件。
    解决方法比如:#pragma comment(lib,"???.lib")或者在设置里面添加。
      

  3.   

    Hit ALT + F7
    Hit the + next to Configuration Properties
    Hit the + next to Linker
    Select Input
    On the right, you'll see 'Additional Dependencies'
    Add the following:
    kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib
    It will work.
    from:http://social.msdn.microsoft.com/Forums/uk/Vsexpressvc/thread/72c31600-9002-440f-950b-985949a84373