[Paraview] [CMake] Is this page outdated? http://www.cmake.org/Wiki/BuildingWinDLL

David Cole david.cole at kitware.com
Tue Jul 6 08:33:31 EDT 2010


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.



On Tue, Jul 6, 2010 at 7:56 AM, Fred Fred <stan1313 at hotmail.fr> wrote:

>  Because I tried it but it did not work:
>   - the first error is due to this line:   static MYLIB_EXPORT
> vtkFiniteDifference *New();
>     that is I followed the advice at the end of the cmake page:
> If you have some static functions then you will need something like the
> following:
>
> class MyStaticFunctionClass
> {
>   public:
>     static MYLIB_EXPORT void MyExportedFunction(int i);
> };
>
> but it seems that it does not work with constructors since contructors do
> not have any return type.
>
> My CMakeFiles.txt looks like this:
>
> FIND_PACKAGE(ParaView REQUIRED)
> INCLUDE(${PARAVIEW_USE_FILE})
>
> ADD_LIBRARY(vtkFiniteDifference SHARED vtkFiniteDifference.cxx)
>
> # Add the new plugin in the MOSART submenu
> ADD_PARAVIEW_PLUGIN(FiniteDifference "1.0"
>                     SERVER_MANAGER_XML FiniteDifference.xml
>                     SERVER_MANAGER_SOURCES vtkFiniteDifference.cxx
>                     GUI_RESOURCE_FILES ../MOSART_GUI.xml)
>
> INCLUDE_DIRECTORIES(/Developpement/ParaView-3.8.0/VTK)
>
> Is there any redondancy between the ADD_LIBRARY and the ADD_PARAVIEW_PLUGIN
> lines?
>
> Any help?
>
>
> ------ Build started: Project: FiniteDifference, Configuration: Release
> Win32 ------
> Compiling...
> vtkFiniteDifferenceClientServer.cxx
> C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(34)
> : error C2487: 'New' : member of dll interface class may not be declared
> with dll interface
> vtkFiniteDifference.cxx
> C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(34)
> : error C2487: 'New' : member of dll interface class may not be declared
> with dll interface
> ..\vtkFiniteDifference.cxx(24) : warning C4273:
> 'vtkFiniteDifference::CollectRevisions' : inconsistent dll linkage
>
> C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(29)
> : see previous definition of 'CollectRevisions'
> ..\vtkFiniteDifference.cxx(25) : warning C4273: 'vtkFiniteDifference::New'
> : inconsistent dll linkage
>
> C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(34)
> : see previous definition of 'New'
> ..\vtkFiniteDifference.cxx(28) : warning C4273:
> 'vtkFiniteDifference::vtkFiniteDifference' : inconsistent dll linkage
>
> C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(58)
> : see previous definition of '{ctor}'
> ..\vtkFiniteDifference.cxx(33) : warning C4273:
> 'vtkFiniteDifference::~vtkFiniteDifference' : inconsistent dll linkage
>
> C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(59)
> : see previous definition of '{dtor}'
> ..\vtkFiniteDifference.cxx(41) : warning C4273:
> 'vtkFiniteDifference::RequestData' : inconsistent dll linkage
>
> C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(61)
> : see previous definition of 'RequestData'
> ..\vtkFiniteDifference.cxx(124) : warning C4273:
> 'vtkFiniteDifference::SetAxis' : inconsistent dll linkage
>
> C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(51)
> : see previous definition of 'SetAxis'
> ..\vtkFiniteDifference.cxx(132) : warning C4273:
> 'vtkFiniteDifference::PrintSelf' : inconsistent dll linkage
>
> C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(30)
> : see previous definition of 'PrintSelf'
> Generating Code...
> Build log was saved at
> "file://c:\Developpement\ParaView_Plugins\FiniteDifference\PV\FiniteDifference.dir\Release\BuildLog.htm"
> FiniteDifference - 2 error(s), 7 warning(s)
> ------ Build started: Project: vtkFiniteDifference, Configuration: Release
> Win32 ------
> Compiling...
> vtkFiniteDifference.cxx
> C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(34)
> : error C2487: 'New' : member of dll interface class may not be declared
> with dll interface
> ..\vtkFiniteDifference.cxx(24) : warning C4273:
> 'vtkFiniteDifference::CollectRevisions' : inconsistent dll linkage
>
> C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(29)
> : see previous definition of 'CollectRevisions'
> ..\vtkFiniteDifference.cxx(25) : warning C4273: 'vtkFiniteDifference::New'
> : inconsistent dll linkage
>
> C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(34)
> : see previous definition of 'New'
> ..\vtkFiniteDifference.cxx(28) : warning C4273:
> 'vtkFiniteDifference::vtkFiniteDifference' : inconsistent dll linkage
>
> C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(58)
> : see previous definition of '{ctor}'
> ..\vtkFiniteDifference.cxx(33) : warning C4273:
> 'vtkFiniteDifference::~vtkFiniteDifference' : inconsistent dll linkage
>
> C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(59)
> : see previous definition of '{dtor}'
> ..\vtkFiniteDifference.cxx(41) : warning C4273:
> 'vtkFiniteDifference::RequestData' : inconsistent dll linkage
>
> C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(61)
> : see previous definition of 'RequestData'
> ..\vtkFiniteDifference.cxx(124) : warning C4273:
> 'vtkFiniteDifference::SetAxis' : inconsistent dll linkage
>
> C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(51)
> : see previous definition of 'SetAxis'
> ..\vtkFiniteDifference.cxx(132) : warning C4273:
> 'vtkFiniteDifference::PrintSelf' : inconsistent dll linkage
>
> C:\Developpement\ParaView_Plugins\FiniteDifference\vtkFiniteDifference.h(30)
> : see previous definition of 'PrintSelf'
> Build log was saved at
> "file://c:\Developpement\ParaView_Plugins\FiniteDifference\PV\vtkFiniteDifference.dir\Release\BuildLog.htm"
> vtkFiniteDifference - 1 error(s), 7 warning(s)
> ------ Skipped Build: Project: ALL_BUILD, Configuration: Release Win32
> ------
> Project not selected to build for this solution configuration
> ========== Build: 0 succeeded, 2 failed, 1 up-to-date, 1 skipped ==========
>
>
> ------------------------------
> Votre vie privée l'est-elle vraiment ? Internet Explorer 8 vous protège
> gratuitement <http://clk.atdmt.com/FRM/go/232102478/direct/01/>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100706/dcf17810/attachment.htm>


More information about the ParaView mailing list