error LNK2019: unresolved external symbol 错误处理

前些天折腾winio程序模拟键盘鼠标消息,从网上和 internals.com官方下载实例代码后,却发现提示类似:

 

1>Testwinio.obj : error LNK2019: unresolved external symbol __imp__GetPortVal@12 referenced in function "void __cdecl KBCWait4IBE(void)" (?KBCWait4IBE@@YAXXZ)
1>Testwinio.obj : error LNK2019: unresolved external symbol __imp__SetPortVal@12 referenced in function "void __cdecl KEY_DOWN(int)" (?KEY_DOWN@@YAXH@Z)
1>Testwinio.obj : error LNK2019: unresolved external symbol __imp__InitializeWinIo@0 referenced in function _main
1>Testwinio.obj : error LNK2019: unresolved external symbol __imp__ShutdownWinIo@0 referenced in function _main
1>Testwinio.obj : error LNK2019: unresolved external symbol __imp__RemoveWinIoDriver@0 referenced in function _main
1>Testwinio.obj : error LNK2019: unresolved external symbol __imp__InstallWinIoDriver@8 referenced in function _main
1>MSVCRTD.lib(wcrtexe.obj) : error LNK2019: unresolved external symbol _wmain referenced in function ___tmainCRTStartup
1>C:/Documents and Settings/桌面/myvc/Testwinio/Debug/Testwinio.exe : fatal error LNK1120: 7 unresolved externals
1>FileTracker : warning : Attempt to load UI satellite dll from c:/WINDOWS/Microsoft.NET/Framework/v4.0.20506/2052/FileTrackerUI.dll failed.
1>FileTracker : warning : Attempt to load UI satellite dll from c:/WINDOWS/Microsoft.NET/Framework/v4.0.20506/2052/TrackerUI.dll failed.

仔细查看代码后,可以肯定是代码没问题,并且完全按照winio的帮助文件操作的,已经包含了winio.h,也添加了winio.lib到工程里,最后终于找到问题

如果程序中加入了.lib的文件,需要在visual studio中添加个路径,否则即使你将.lib加入到solution后也不能调用其中的函数

 

具体设置为:porject------>property------>configuration properties------>linker----->Input------>Additional dependencies中添加上你的lib文件名

你可能感兴趣的:(error LNK2019: unresolved external symbol 错误处理)