0

Resolved

ComponentChk.obj : error LNK2019: unresolved external symbol __imp__WaitForInputIdle ...

description

Trying to compile the ComponentChk.cpp code from
 
C:>cl.exe /Oxs /MT /GS ComponentChk.cpp advapi32.lib
   Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
   Copyright (C) Microsoft Corporation.  All rights reserved.
ComponentChk.cpp
Microsoft (R) Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation.  All rights reserved.
/out:ComponentChk.exe
ComponentChk.obj
advapi32.lib
ComponentChk.obj : error LNK2019: unresolved external symbol __imp__WaitForInputIdle@8 referenced in function "int __cdecl MyStart(char const *,char const *)" (?MyStart@@YAHPBD0@Z) ComponentChk.exe : fatal error LNK1120: 1 unresolved externals

comments

wrote Jun 2, 2008 at 4:08 PM

I eventually realized that if WaitForInputIdle() didn't exist as a named function in the source code, perhaps it existed in another library that wasn't yet connected to the code?  A quick MSDN Library search told me (http://msdn.microsoft.com/en-us/library/ms687022.aspx) this function was actually part of USER32.DLL, and it wasn't too painful a leap of logic to try adding USER32.LIB to the compilation parameters, like so:

cl.exe /Oxs /MT /GS ComponentChk.cpp advapi32.lib user32.lib

wrote Feb 13, 2013 at 11:01 PM

wrote May 16, 2013 at 4:14 AM

wrote May 16, 2013 at 4:14 AM

wrote Jun 14, 2013 at 8:19 AM