Though the file "cfgmgr32.lib" is added to link modules,
the following code written in Visual C++ 6.0 generates the linkage error:
What is the possible cause of this error?

#include "stdafx.h"
#include <windows.h>
#include <wtypes.h>
#include <cfgmgr32.h>

int main(int argc, char* argv[])
{
CM_Request_Device_Eject(NULL,NULL,NULL,0,0);
return(0);
}


Error LNK2001: unresolved external symbol __imp__CM_Request_Device_EjectA@20
Debug/c33.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

Re: DDK linkage problem... by Burkhardt

Burkhardt
Tue Nov 22 05:07:15 CST 2005



ilhan wrote:
> Though the file "cfgmgr32.lib" is added to link modules,
> the following code written in Visual C++ 6.0 generates the linkage error:
> What is the possible cause of this error?
>
> #include "stdafx.h"
> #include <windows.h>
> #include <wtypes.h>
> #include <cfgmgr32.h>
>
> int main(int argc, char* argv[])
> {
> CM_Request_Device_Eject(NULL,NULL,NULL,0,0);
> return(0);
> }
>
>
> Error LNK2001: unresolved external symbol __imp__CM_Request_Device_EjectA@20
> Debug/c33.exe : fatal error LNK1120: 1 unresolved externals
> Error executing link.exe.
>
Function CM_Request_Device_Eject is exported from setupapi.lib.
Kind regards
Burkhardt Braun