Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > trouble with .lib file export - class exported, but not as expected.

Reply
Thread Tools

trouble with .lib file export - class exported, but not as expected.

 
 
acc13
Guest
Posts: n/a
 
      07-31-2006
I have written a .dll that exports a class MyClass, which has a member
function MyFunction(LPCWSTR szMyString).

If I build (I'm using VC7) with the /showIncludes option, I can see
that LPCWSTR is defined in file ...\platformsdk\include\winnt.h as:

typedef __nullterminated CONST WCHAR *LPCWSTR, *PCWSTR;

and WCHAR is in turn defined as:

#ifndef _MAC
typedef wchar_t WCHAR; // wc, 16-bit UNICODE character
#else
// some Macintosh compilers don't define wchar_t in a convenient
location, or define it as a char
typedef unsigned short WCHAR; // wc, 16-bit UNICODE character
#endif

I have (obviously) not defined _MAC (I even verified that no rogue
include did so by testing "#ifdef _MAC\n#error _MAC defined!\n#endif),
so I expect the .lib file to export the function

long __thiscall MyClass::MyFunction(wchar_t const *)

Instead the output from dumpbin shows that my lib file exports the
function,

long __thiscall MyClass::MyFunction(unsigned short const *)

and my test dll client program builds with a LNK2019 unresolved
external symbol.
What's the deal?
Thanks in advance for any help on the matter...

 
Reply With Quote
 
 
 
 
mlimber
Guest
Posts: n/a
 
      07-31-2006
acc13 wrote:
> I have written a .dll that exports a class MyClass, which has a member
> function MyFunction(LPCWSTR szMyString).
>
> If I build (I'm using VC7) with the /showIncludes option, I can see
> that LPCWSTR is defined in file ...\platformsdk\include\winnt.h as:
>
> typedef __nullterminated CONST WCHAR *LPCWSTR, *PCWSTR;
>
> and WCHAR is in turn defined as:
>
> #ifndef _MAC
> typedef wchar_t WCHAR; // wc, 16-bit UNICODE character
> #else
> // some Macintosh compilers don't define wchar_t in a convenient
> location, or define it as a char
> typedef unsigned short WCHAR; // wc, 16-bit UNICODE character
> #endif
>
> I have (obviously) not defined _MAC (I even verified that no rogue
> include did so by testing "#ifdef _MAC\n#error _MAC defined!\n#endif),
> so I expect the .lib file to export the function
>
> long __thiscall MyClass::MyFunction(wchar_t const *)
>
> Instead the output from dumpbin shows that my lib file exports the
> function,
>
> long __thiscall MyClass::MyFunction(unsigned short const *)
>
> and my test dll client program builds with a LNK2019 unresolved
> external symbol.
> What's the deal?


This question should be asked on a Microsoft-specific newsgroup. See
this FAQ for what is on-topic here and for a list of other places you
could try:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

Cheers! --M

 
Reply With Quote
 
 
 
 
acc13
Guest
Posts: n/a
 
      07-31-2006
Thanks, I appreciate the heads up.

New to newsgroups...

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Export to PDF with google maps + msacces export Maarten Porters Ruby 1 07-28-2008 01:45 PM
My Project Works Inside Eclipse But Not When I Export cppaddict Java 2 02-26-2007 09:45 PM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
A parameterized class (i.e. template class / class template) is not a class? christopher diggins C++ 16 05-04-2005 12:26 AM
Invalid export DLL or export format =?Utf-8?B?RGF2aWQgVmFsbGU=?= ASP .Net 0 10-29-2003 11:46 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57