help exporting stl::string from dll 
Author Message
 help exporting stl::string from dll

Hi:
I am trying to create a dll that has a class in it:

#ifdef DLL_EXPORT
#  define LIBSPEC __declspec(dllexport)
#else
#  ifdef DLL_IMPORT
#    define LIBSPEC __declspec(dllimport)
#endif

class LIBSPEC Foo
{
public:
  Foo()                      {            }
  Foo(const string& st)      { parse(st); }

 ~Foo()                      {            }

  const string& string()      const { return myString; }

private:

  string myString;

Quote:
};

I get the following compilation error:
E:\Foo.h(28) : warning C4251: 'myString' : class
'std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char>>' needs to have dll-interface to be used by clients
of class 'Foo'

I know that a similar issue (vector<char>) is covered pretty well by the
MS Support
( http://www.*-*-*.com/ ),
but I can't figure out how to apply it to this one because string is a
completed template.  I would appreciate any help.

Thanks,
Jordan



Fri, 20 Apr 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Dll exports and STL string

2. DLL export and STL string

3. Need help exporting std::string from dll

4. Exporting string from dll using non DLL version of CRT

5. Exporting STL containers (specifically std::map) from DLL?

6. exporting STL from DLL

7. Exporting a STL descendant from a DLL

8. Problems exporting STL-based classes from a DLL

9. STL members of a class exported from a DLL

10. Exporting class from DLL when class derives from STL

11. Export STL set from DLL

12. Deriving from a STL for a DLL exported function

 

 
Powered by phpBB® Forum Software