Try explicitly specifying your calling conventions. The WDK defaults to __stdcall, whereas VS defaults to __cdecl.
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Lloyd
Sent: Monday, December 28, 2009 9:11 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] static library with DDK
Thanks Doron Holan. When I try to link this library with my usermode
application it gives me unresolved symbol error.
This is how my usermode applicaiton look like
extern “C”
{
int DoSomething();
}
int main()
{
return DoSomething();
}
Then it returns unresolved external symbol “int __cdecl DoSomething(void)” .
I have made necessary library settings in my application like setting the
library path and additional dependencies. This is the linker settings of my
user mode application.
/OUT:“C:\Documents and Settings\Devel\Desktop\test\Debug\test.exe”
/INCREMENTAL /NOLOGO /LIBPATH:“D:\Drivers\temp\objchk_wxp_x86\i386”
/MANIFEST /MANIFESTFILE:“Debug\test.exe.intermediate.manifest” /DEBUG
/PDB:“c:\Documents and Settings\Devel\Desktop\test\debug\test.pdb”
/SUBSYSTEM:CONSOLE /MACHINE:X86 /ERRORREPORT:PROMPT mylib.lib kernel32.lib
user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib
ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
Where could be the problem? Is the static library made with DDK is same as
making a static library using visual studio?
Thanks again,
Lloyd
----- Original Message -----
From: Doron Holan
To: Windows System Software Devs Interest List
Sent: Tuesday, December 29, 2009 10:20 AM
Subject: RE: [ntdev] static library with DDK
Libs do not export functions. They either contain import resolutions or
code. Yours contains code. Just link and exe or dl or sys against your lib
and you will be fine
d
Scanned and protected by Email scanner
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer