User-defined ctor not exported from DLL 
Author Message
 User-defined ctor not exported from DLL

**Please note this was also posted to microsoft.public.vsnet.general**

I have an interesting problem that I can't duplicate with
a test app or with a different compiler (VC6, in this
case):

A class, with no default ctor and 1 user-defined ctor, is
exported from a DLL that normally has C-style functions.
This DLL is in fact mostly written in C, but there is one
class exported that provides a class wrapper to the C
functions. The DLL builds just fine with no problem.

My app that uses this exported class attempts to create
an instance using the ctor. Example of the ctor :

CTest( const std::wstring& inString, const std::wstring&
inString2, long inLong );

If I call this ctor, I get an unresolved external symbol
and the basic_string template is expanded out, etc. If I
remove the 2 wstring parameters and leave only the long,
no problem occurs. I even tried adding a default ctor and
that exported just fine. If I have a ctor with just one
wstring parameter, I get the unresolved error once again.

My test app didn't exhibit this problem with VC7, but it
wouldn't find the exported ctor at runtime. VC6 compiles,
links and runs this all just fine. What changed in VC7
that I need to be aware of to fix this problem? I'd
really hate to have a default ctor with methods to
populate the values that are normally passed in.

greg norz



Tue, 19 Oct 2004 05:00:55 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. How to export a class from DLL(not Activex dll)

2. Problems exporting class in static lib from a Win32 DLL when a copy constructor is defined

3. advanced user: how to export classes from a DLL like MFC

4. advanced user: how to export classes from a DLL like MFC

5. Passing a user defined type to a DLL

6. User Defined Type and DLL

7. Passing user defined structures from VB to C++ DLL

8. Passing a user defined type to a DLL

9. function is exported in my dll, but not by my code

10. How to export TLB and not DLL?

11. My DLL exports some symbols but not all of them

12. Windows DLL exported functions not accessible

 

 
Powered by phpBB® Forum Software