<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>''needs to have dll-interface' warning' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread ''needs to have dll-interface' warning' posted on the 'C and C++' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Thu, 09 Feb 2012 08:25:56 -0800</pubDate>
    <lastBuildDate>Thu, 09 Feb 2012 08:25:56 -0800</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>'needs to have dll-interface' warning</title>
      <link>http://www.programmersheaven.com/mb/CandCPP/310449/310449/needs-to-have-dll-interface-warning/</link>
      <description>Hi,&lt;br /&gt;
I need some help with dlls. It's my first time writting dlls and I have a minor problem.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
#ifdef MYPROJ_EXPORTS
#define _myprojExport __declspec(dllexport)
#else
#define _myprojExport __declspec(dllimport)
#endif

class _myprojExport MyClass
{
...
protected:
	typedef std::list&amp;lt;std::string&amp;gt; StringList;
	StringList mylist;
};
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
As you can see on the above code I have MyClass which is a simple class that I export. When mylist member is missing everything is compiled smoothly, however when I have mylist member variable on the class I get the following warning from my compiler (VS .NET 7.1).&lt;br /&gt;
&lt;br /&gt;
warning C4251: 'MyClass::mylist' : class 'std::list&amp;lt;_Ty&amp;gt;' needs to have dll-interface to be used by clients of class 'MyClass'&lt;br /&gt;
        with&lt;br /&gt;
        [&lt;br /&gt;
            _Ty=std::string&lt;br /&gt;
        ]&lt;br /&gt;
&lt;br /&gt;
How can I create a dll-interface for std::list? I don't have to export std::list the client will find its implementation in &amp;lt;list&amp;gt;. How should I declare mylist in order to get rid of these warnings?&lt;br /&gt;
&lt;br /&gt;
Thanks in advance,&lt;br /&gt;
Themis&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/CandCPP/310449/310449/needs-to-have-dll-interface-warning/</guid>
      <pubDate>Thu, 28 Jul 2005 10:42:05 -0800</pubDate>
      <category>C and C++</category>
    </item>
    <item>
      <title>Re: 'needs to have dll-interface' warning</title>
      <link>http://www.programmersheaven.com/mb/CandCPP/310449/310450/re-needs-to-have-dll-interface-warning/#310450</link>
      <description>: Hi,&lt;br /&gt;
: I need some help with dlls. It's my first time writting dlls and I have a minor problem.&lt;br /&gt;
: &lt;br /&gt;
: &lt;pre class="sourcecode"&gt;
: #ifdef MYPROJ_EXPORTS
: #define _myprojExport __declspec(dllexport)
: #else
: #define _myprojExport __declspec(dllimport)
: #endif
: 
: class _myprojExport MyClass
: {
: ...
: protected:
: 	typedef std::list&amp;lt;std::string&amp;gt; StringList;
: 	StringList mylist;
: };
: &lt;/pre&gt;&lt;br /&gt;
: &lt;br /&gt;
: As you can see on the above code I have MyClass which is a simple class that I export. When mylist member is missing everything is compiled smoothly, however when I have mylist member variable on the class I get the following warning from my compiler (VS .NET 7.1).&lt;br /&gt;
: &lt;br /&gt;
: warning C4251: 'MyClass::mylist' : class 'std::list&amp;lt;_Ty&amp;gt;' needs to have dll-interface to be used by clients of class 'MyClass'&lt;br /&gt;
:         with&lt;br /&gt;
:         [&lt;br /&gt;
:             _Ty=std::string&lt;br /&gt;
:         ]&lt;br /&gt;
: &lt;br /&gt;
: How can I create a dll-interface for std::list? I don't have to export std::list the client will find its implementation in &amp;lt;list&amp;gt;. How should I declare mylist in order to get rid of these warnings?&lt;br /&gt;
: &lt;br /&gt;
: Thanks in advance,&lt;br /&gt;
: Themis&lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
templates can't be exported -- but I think you can safely ignore the error if the application program will not have access to the template object.&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/CandCPP/310449/310450/re-needs-to-have-dll-interface-warning/#310450</guid>
      <pubDate>Thu, 28 Jul 2005 10:56:24 -0800</pubDate>
      <category>C and C++</category>
    </item>
    <item>
      <title>Re: 'needs to have dll-interface' warning</title>
      <link>http://www.programmersheaven.com/mb/CandCPP/310449/310491/re-needs-to-have-dll-interface-warning/#310491</link>
      <description>: &lt;br /&gt;
: templates can't be exported -- but I think you can safely ignore the error if the application program will not have access to the template object.&lt;br /&gt;
: &lt;br /&gt;
: &lt;br /&gt;
&lt;br /&gt;
Isn't there any way to get rid of because it polutes my build log and task list.&lt;br /&gt;
&lt;br /&gt;
Themis&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/CandCPP/310449/310491/re-needs-to-have-dll-interface-warning/#310491</guid>
      <pubDate>Fri, 29 Jul 2005 00:53:38 -0800</pubDate>
      <category>C and C++</category>
    </item>
    <item>
      <title>Re: 'needs to have dll-interface' warning</title>
      <link>http://www.programmersheaven.com/mb/CandCPP/310449/310503/re-needs-to-have-dll-interface-warning/#310503</link>
      <description>: : &lt;br /&gt;
: : templates can't be exported -- but I think you can safely ignore the error if the application program will not have access to the template object.&lt;br /&gt;
: : &lt;br /&gt;
: : &lt;br /&gt;
: &lt;br /&gt;
: Isn't there any way to get rid of because it polutes my build log and task list.&lt;br /&gt;
: &lt;br /&gt;
: Themis&lt;br /&gt;
: &lt;br /&gt;
&lt;pre class="sourcecode"&gt;
#pragma warning(disable: xxxx) // replace xxxx with warning number
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/CandCPP/310449/310503/re-needs-to-have-dll-interface-warning/#310503</guid>
      <pubDate>Fri, 29 Jul 2005 03:50:13 -0800</pubDate>
      <category>C and C++</category>
    </item>
    <item>
      <title>Re: 'needs to have dll-interface' warning</title>
      <link>http://www.programmersheaven.com/mb/CandCPP/310449/425094/re-needs-to-have-dll-interface-warning/#425094</link>
      <description>do not export entire class. Export only the needed functions and data.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/CandCPP/310449/425094/re-needs-to-have-dll-interface-warning/#425094</guid>
      <pubDate>Wed, 05 Oct 2011 17:59:48 -0800</pubDate>
      <category>C and C++</category>
    </item>
  </channel>
</rss>
