If you want the constructor exported, you should export the class (which exports all of its public API), not a single function within the class. Also, if you export a class, all of its parent classes should also be exported.<div>
<br><br><div><br><div class="gmail_quote">On Tue, Jul 6, 2010 at 7:56 AM, Fred Fred <span dir="ltr">&lt;<a href="mailto:stan1313@hotmail.fr">stan1313@hotmail.fr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">




<div>
Because I tried it but it did not work:<br>  - the first error is due to this line:   static MYLIB_EXPORT vtkFiniteDifference *New();<br>    that is I followed the advice at the end of the cmake page:<br>If you have some static functions then you will need something like 
the following: <br>
<br>
<pre>class MyStaticFunctionClass<br>{<br>  public:<br>    static MYLIB_EXPORT void MyExportedFunction(int i);<br>};<br></pre>but it seems that it does not work with constructors since contructors do not have any return type.<br>
<br>My CMakeFiles.txt looks like this:<br><br>FIND_PACKAGE(ParaView REQUIRED)<br>INCLUDE(${PARAVIEW_USE_FILE})<br><br>ADD_LIBRARY(vtkFiniteDifference SHARED vtkFiniteDifference.cxx)<br><br># Add the new plugin in the MOSART submenu<br>
ADD_PARAVIEW_PLUGIN(FiniteDifference &quot;1.0&quot;<br>                    SERVER_MANAGER_XML FiniteDifference.xml <br>                    SERVER_MANAGER_SOURCES vtkFiniteDifference.cxx<br>                    GUI_RESOURCE_FILES ../MOSART_GUI.xml)<br>
<br>INCLUDE_DIRECTORIES(/Developpement/ParaView-3.8.0/VTK)<br><br>Is there any redondancy between the ADD_LIBRARY and the ADD_PARAVIEW_PLUGIN lines?<br><br>Any help?<br><br><br>------ Build started: Project: FiniteDifference, Configuration: Release Win32 ------<br>
Compiling...<br>vtkFiniteDifferenceClientServer.cxx<br>C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(34) : error C2487: &#39;New&#39; : member of dll interface class may not be declared with dll interface<br>
vtkFiniteDifference.cxx<br>C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(34) : error C2487: &#39;New&#39; : member of dll interface class may not be declared with dll interface<br>..\vtkFiniteDifference.cxx(24) : warning C4273: &#39;vtkFiniteDifference::CollectRevisions&#39; : inconsistent dll linkage<br>
        C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(29) : see previous definition of &#39;CollectRevisions&#39;<br>..\vtkFiniteDifference.cxx(25) : warning C4273: &#39;vtkFiniteDifference::New&#39; : inconsistent dll linkage<br>
        C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(34) : see previous definition of &#39;New&#39;<br>..\vtkFiniteDifference.cxx(28) : warning C4273: &#39;vtkFiniteDifference::vtkFiniteDifference&#39; : inconsistent dll linkage<br>
        C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(58) : see previous definition of &#39;{ctor}&#39;<br>..\vtkFiniteDifference.cxx(33) : warning C4273: &#39;vtkFiniteDifference::~vtkFiniteDifference&#39; : inconsistent dll linkage<br>
        C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(59) : see previous definition of &#39;{dtor}&#39;<br>..\vtkFiniteDifference.cxx(41) : warning C4273: &#39;vtkFiniteDifference::RequestData&#39; : inconsistent dll linkage<br>
        C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(61) : see previous definition of &#39;RequestData&#39;<br>..\vtkFiniteDifference.cxx(124) : warning C4273: &#39;vtkFiniteDifference::SetAxis&#39; : inconsistent dll linkage<br>
        C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(51) : see previous definition of &#39;SetAxis&#39;<br>..\vtkFiniteDifference.cxx(132) : warning C4273: &#39;vtkFiniteDifference::PrintSelf&#39; : inconsistent dll linkage<br>
        C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(30) : see previous definition of &#39;PrintSelf&#39;<br>Generating Code...<br>Build log was saved at &quot;file://c:\Developpement\ParaView_Plugins\FiniteDifference\PV\FiniteDifference.dir\Release\BuildLog.htm&quot;<br>
FiniteDifference - 2 error(s), 7 warning(s)<br>------ Build started: Project: vtkFiniteDifference, Configuration: Release Win32 ------<br>Compiling...<br>vtkFiniteDifference.cxx<br>C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(34) : error C2487: &#39;New&#39; : member of dll interface class may not be declared with dll interface<br>
..\vtkFiniteDifference.cxx(24) : warning C4273: &#39;vtkFiniteDifference::CollectRevisions&#39; : inconsistent dll linkage<br>        C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(29) : see previous definition of &#39;CollectRevisions&#39;<br>
..\vtkFiniteDifference.cxx(25) : warning C4273: &#39;vtkFiniteDifference::New&#39; : inconsistent dll linkage<br>        C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(34) : see previous definition of &#39;New&#39;<br>
..\vtkFiniteDifference.cxx(28) : warning C4273: &#39;vtkFiniteDifference::vtkFiniteDifference&#39; : inconsistent dll linkage<br>        C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(58) : see previous definition of &#39;{ctor}&#39;<br>
..\vtkFiniteDifference.cxx(33) : warning C4273: &#39;vtkFiniteDifference::~vtkFiniteDifference&#39; : inconsistent dll linkage<br>        C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(59) : see previous definition of &#39;{dtor}&#39;<br>
..\vtkFiniteDifference.cxx(41) : warning C4273: &#39;vtkFiniteDifference::RequestData&#39; : inconsistent dll linkage<br>        C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(61) : see previous definition of &#39;RequestData&#39;<br>
..\vtkFiniteDifference.cxx(124) : warning C4273: &#39;vtkFiniteDifference::SetAxis&#39; : inconsistent dll linkage<br>        C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(51) : see previous definition of &#39;SetAxis&#39;<br>
..\vtkFiniteDifference.cxx(132) : warning C4273: &#39;vtkFiniteDifference::PrintSelf&#39; : inconsistent dll linkage<br>        C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(30) : see previous definition of &#39;PrintSelf&#39;<br>
Build log was saved at &quot;file://c:\Developpement\ParaView_Plugins\FiniteDifference\PV\vtkFiniteDifference.dir\Release\BuildLog.htm&quot;<br>vtkFiniteDifference - 1 error(s), 7 warning(s)<br>------ Skipped Build: Project: ALL_BUILD, Configuration: Release Win32 ------<br>
Project not selected to build for this solution configuration <br>========== Build: 0 succeeded, 2 failed, 1 up-to-date, 1 skipped ==========<br><br>                                               <br><hr>Votre vie privée l&#39;est-elle vraiment ? <a href="http://clk.atdmt.com/FRM/go/232102478/direct/01/" target="_blank">Internet Explorer 8 vous protège gratuitement</a></div>

<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div></div>