stdlib types as members in dll exported class

I

Ingo Nolden

Hi there,

following example:


class __declspec( dllexport ) Example
{
public:
// ... some public funcs

private:
std::list<MyListObject> _InnerList;
};

if I compile this the compiler issues a warning:

blabla: std::list needs to have dll-interface to be used by clients of
the class Example

Ok, I see, that I have an exported class with a member that is not
exported.
I could use a pointer to the list and allocate from heap, to workaround
this. But I try to use that only if necessary.
The so called "Client" has no access to the member anyway since it is
private.
Does that mean I can ignore the warning ( pragma it away )?

And if the client links to the same runtime, would't it be possible to
use the types from the other library with the data from my dll export?
I mean, the client would compile with the same header file and therefore
use the 'same' type?

Or is there another clean way, that programmers usually do for this
task.

thanks in advance
Ingo
 
P

Pete C.

Ingo Nolden wrote:
class __declspec( dllexport ) Example
{
<snip>

DLLs and other such non-standard extensions are not topical for this group,
try microsoft.public.vc.language.

- Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top