Thread overview | |||||
---|---|---|---|---|---|
|
November 13, 2010 Linkage problem | ||||
---|---|---|---|---|
| ||||
I used implib to create a .lib file for psapi.dll. I also found a header file. The header file contains an ifdef __cplusplus declaration so it appears the linkage should have C semantics. The .lib file shows, among other entry points, the following (using libunres): _EnumProcessModules _EnumProcessModulesEx _EnumProcesses _GetDeviceDriverBaseNameA _GetDeviceDriverBaseNameW The 'EnumProcesses' is the function I am calling in a test application. When it links I get the following error: OPTLINK (R) for Win32 Release 8.00.5 Copyright (C) Digital Mars 1989-2009 All rights reserved. http://www.digitalmars.com/ctg/optlink.html .\Obj\tproclist.obj(tproclist) Error 42: Symbol Undefined _EnumProcesses@12 How can I get this to resolve corrrectly? |
November 26, 2010 Re: Linkage problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to MRatcliff | MRatcliff wrote:
> I used implib to create a .lib file for psapi.dll. I also found a header file.
>
> The header file contains an ifdef __cplusplus declaration so it appears the
> linkage should have C semantics.
>
> The .lib file shows, among other entry points, the following (using libunres):
>
> _EnumProcessModules
> _EnumProcessModulesEx
> _EnumProcesses
> _GetDeviceDriverBaseNameA
> _GetDeviceDriverBaseNameW
> The 'EnumProcesses' is the function I am calling in a test application. When
> it links I get the following error:
>
> OPTLINK (R) for Win32 Release 8.00.5
> Copyright (C) Digital Mars 1989-2009 All rights reserved.
> http://www.digitalmars.com/ctg/optlink.html
> .\Obj\tproclist.obj(tproclist)
> Error 42: Symbol Undefined _EnumProcesses@12
>
> How can I get this to resolve corrrectly?
The @12 means it is compiled using the stdcall calling convention, not the C++ calling convention.
|
November 27, 2010 Re: Linkage problem | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Thanks - Problem resolved by removing the WINAPI macro from the header file. BOOL WINAPI EnumProcesses(DWORD *,DWORD,DWORD *); To BOOL EnumProcesses(DWORD *,DWORD,DWORD *); |
Copyright © 1999-2021 by the D Language Foundation