LNK2019 - 未解析的外部符号

时间:2012-07-14 06:34:45

标签: c++ visual-studio

我收到以下链接错误。

1>------ Build started: Project: NowHook, Configuration: Debug Win32 ------
1>Compiling...

1>NowHook.CPP
1>Linking...

1>NowHook.obj : error LNK2019: unresolved external symbol __imp__VirtualProtect@16 referenced in function "void __cdecl 

1>NowHook.obj : error LNK2019: unresolved external symbol __imp__GetProcAddress@8 referenced in function "void __cdecl 

1>NowHook.obj : error LNK2019: unresolved external symbol __imp__LoadLibraryA@4 referenced in function "void __cdecl HookSend(void)" (?HookSend@@YAXXZ)

1>C:\Users\JAGAN\Documents\Visual Studio 2008\Projects\HookNow\Debug\NowHook.dll : 
fatal error LNK1120: 3 unresolved externals

1>Build log was saved at "file://c:\Users\JAGAN\Documents\Visual Studio 2008\Projects

我已经包括了 1)Linker / General / AdditionalLibraryDirectories
2)链接器/输入/附加依赖性

1 个答案:

答案 0 :(得分:3)

您的链接器/输入/附加依赖项中缺少kernel32.lib

确保您为“所有配置”和“所有平台”设置附加依赖项。

enter image description here