Re: Name decoration Problem
From: John Phillips (jjphillipsREMOVE_at_REMOVEhotmail.com)
Date: 03/02/04
- Next message: vic: "DCOM slow activation..."
- Previous message: Michael Pierce: "Re: Name decoration Problem"
- In reply to: Michael Pierce: "Re: Name decoration Problem"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 2 Mar 2004 14:34:17 -0500
Yes, check out the documentation for /DEFAULTLIB (here I'm assuming you're
compiling the sample from the command line).
Or, in your code, you can do something like this:
#pragma comment(linker, "/defaultlib:MyDLL.lib")
--
John Phillips
MVP - Windows SDK
"Michael Pierce" <Michael.Pierce@_RE_MOVE_tentechnologies.com> wrote in
message news:hI41c.107259$n62.3619@twister.nyroc.rr.com...
> No. I placed a copy of the .h file, and the *.dll file in
> "C:\DDK\WINDDK\2600.1106\src\print\oemdll\CST_watermark_NT\wmarkps".
Should
> I be linking with the .lib file? If so, how is that done?
>
> "John Phillips" <jjphillipsREMOVE@REMOVEhotmail.com> wrote in message
> news:u0CYszHAEHA.2180@TK2MSFTNGP09.phx.gbl...
> > Are you linking with the DLL's .lib file?
> >
> > --
> > John Phillips
> > MVP - Windows SDK
> >
> >
> > "Michael Pierce" <Michael.Pierce@_RE_MOVE_tentechnologies.com> wrote in
> > message news:uD21c.105790$n62.60898@twister.nyroc.rr.com...
> > > I am having a problem with name decoration. I have a Win32 DLL with
one
> > > exported function and the pertinent code pieces are:
> > >
> > >
> > >
> > > *.def file
> > >
> > > Exports
> > >
> > > GenerateJobID
> > >
> > >
> > >
> > >
> > >
> > > *.h file
> > >
> > > #ifdef __cplusplus
> > >
> > > extern "C" {
> > >
> > > #endif /* __cplusplus */
> > >
> > >
> > >
> > > __declspec( dllexport ) WCHAR * GenerateJobID();
> > >
> > >
> > >
> > > #ifdef __cplusplus
> > >
> > > }
> > >
> > > #endif
> > >
> > >
> > >
> > >
> > >
> > > *.cpp file
> > >
> > > WCHAR * GenerateJobID()
> > >
> > > {
> > >
> > > /*****/
> > >
> > > }
> > >
> > >
> > >
> > >
> > >
> > > When viewing the *.lib file I see "__imp__GenerateJobID", which I
> believe
> > is
> > > correct.
> > >
> > >
> > >
> > > I want to now import this method into a DDK sample
> > >
> >
>
(C:\DDK\WINDDK\2600.1106\src\print\oemdll\CST_watermark_NT\wmarkps\command.c
> > > pp).
> > >
> > >
> > >
> > > Command.cpp has the following code pieces:
> > >
> > > #include "TenApi.h"
> > >
> > > .
> > >
> > > extern "C" {
> > >
> > > __declspec( dllimport ) WCHAR * GenerateJobID();
> > >
> > > }
> > >
> > >
> > >
> > > .
> > >
> > > void foo()
> > >
> > > {
> > >
> > > WCHAR * wszTemp;
> > >
> > > wszTemp = GenerateJobID();
> > >
> > > }
> > >
> > >
> > >
> > > When I compile I get the following error: "unresolved external symbol
> > > __imp__GenerateJobID@0 referenced in function "void __stdcall
foo(void)"
> > > (?foo@@YGXXZ)"
> > >
> > >
> > >
> > > If I extern "C" function foo(), I get the following error:
"unresolved
> > > external symbol __imp__GenerateJobID@0 referenced in function _foo@0"
> > >
> > >
> > >
> > > Any idea what I am doing wrong?
> > >
> > >
> >
> >
>
>
- Next message: vic: "DCOM slow activation..."
- Previous message: Michael Pierce: "Re: Name decoration Problem"
- In reply to: Michael Pierce: "Re: Name decoration Problem"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|