[vtkusers] wxWindows/VTK

Brian Arnold brian at math.unm.edu
Tue Jul 1 14:44:59 EDT 2003


I've implemented these changes, and it's made no difference.  I have the 
static vtk libs as far as I can tell, and I'm including the following 
libs (using wxWin 2.4.0):

comctl32.lib rpcrt4.lib winmm.lib advapi32.lib wsock32.lib wxmsw.lib 
vtkCommon.lib vtkRendering.lib vtkGraphics.lib vtkFiltering.lib 
vtkImaging.lib vtkHybrid.lib vtkIO.lib vtktiff.lib vtkjpeg.lib 
vtkzlib.lib vtkfreetype.lib vtkftgl.lib opengl32.lib glu32.lib

The first five libs are recommended on the wxwindows page, the next is 
the one for the wxWin release non-dll implementatin, then the slew of 
vtk and opengl things I need.

The errors I get are all about dll usage, and as far as I can tell, I've 
got neither vtk nor wxwin set up to be used as a dll.  If someone has a 
project file that is working and could be sent to me, I would be 
incredibly grateful.  I've pasted a copy of my errors below, so that it 
can be seen what's happening.

Compiling...
Sample.cpp
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.h(112) : warning C4275: 
non dll-interface class 'wxWindow' used as base for dll-interface class 
'wxVTKRenderWindowInteractor'
         C:\wxWindows-2.4.0\include\wx/msw/window.h(53) : see 
declaration of 'wxWindow'
wxVTKRenderWindowInteractor.cxx
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.h(112) : warning C4275: 
non dll-interface class 'wxWindow' used as base for dll-interface class 
'wxVTKRenderWindowInteractor'
         C:\wxWindows-2.4.0\include\wx/msw/window.h(53) : see 
declaration of 'wxWindow'
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(38) : warning C4273: 
'public: static class wxClassInfo 
wxVTKRenderWindowInteractor::sm_classwxVTKRenderWindowInteractor' : 
inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(38) : error C2491: 
'wxVTKRenderWindowInteractor::sm_classwxVTKRenderWindowInteractor' : 
definition of dllimport static data member not allowed
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(42) : warning C4273: 
'GetEventTable' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(42) : warning C4273: 
'protected: static struct wxEventTable const 
wxVTKRenderWindowInteractor::sm_eventTable' : inconsistent dll linkage. 
  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(42) : error C2491: 
'wxVTKRenderWindowInteractor::sm_eventTable' : definition of dllimport 
static data member not allowed
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(42) : warning C4273: 
'private: static struct wxEventTableEntry const * const 
wxVTKRenderWindowInteractor::sm_eventTableEntries' : inconsistent dll 
linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(42) : error C2491: 
'wxVTKRenderWindowInteractor::sm_eventTableEntries' : definition of 
dllimport static data member not allowed
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(67) : warning C4273: 
'wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor' : 
inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(69) : warning C4355: 
'this' : used in base member initializer list
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(87) : warning C4273: 
'wxVTKRenderWindowInteractor::wxVTKRenderWindowInteractor' : 
inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(89) : warning C4355: 
'this' : used in base member initializer list
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(103) : warning 
C4273: 'wxVTKRenderWindowInteractor::~wxVTKRenderWindowInteractor' : 
inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(111) : warning 
C4273: 'New' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(117) : warning 
C4273: 'Initialize' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(127) : warning 
C4273: 'Enable' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(138) : warning 
C4273: 'Disable' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(149) : warning 
C4273: 'Start' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(156) : warning 
C4273: 'UpdateSize' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(171) : warning 
C4273: 'CreateTimer' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(181) : warning 
C4273: 'DestroyTimer' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(187) : warning 
C4273: 'OnTimer' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(201) : warning 
C4273: 'GetHandle' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(232) : warning 
C4273: 'OnPaint' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(247) : warning 
C4273: 'OnEraseBackground' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(253) : warning 
C4273: 'OnSize' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(271) : warning 
C4273: 'OnMotion' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(289) : warning 
C4273: 'OnEnter' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(309) : warning 
C4273: 'OnLeave' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(329) : warning 
C4273: 'OnKeyDown' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(358) : warning 
C4273: 'OnKeyUp' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(386) : warning 
C4273: 'OnButtonDown' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(442) : warning 
C4273: 'OnButtonUp' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(498) : warning 
C4273: 'Render' : inconsistent dll linkage.  dllexport assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(535) : warning 
C4273: 'SetRenderWhenDisabled' : inconsistent dll linkage.  dllexport 
assumed.
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(552) : warning 
C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
F:\BRIAN\WORK\wxVTK\wxVTKRenderWindowInteractor.cxx(560) : warning 
C4273: 'SetStereo' : inconsistent dll linkage.  dllexport assumed.
Error executing cl.exe.

wxVTK.exe - 3 error(s), 35 warning(s)

~Brian

Nigel Nunn wrote:

> Hi Mathieu, 
>  
> Problem may include a failure of VC++ v6 preprocessor to expand 
> WX_BASE_CLASS in the wx RTTI macros.  Worked fine after explicit 
> expansion of WX_BASE_CLASS (note: linked to static vtk libs) 
>  
> In file wxVTKRenderWindowInteractor.cxx, 
>  
> //IMPLEMENT_DYNAMIC_CLASS(wxVTKRenderWindowInteractor, WX_BASE_CLASS)
>   IMPLEMENT_DYNAMIC_CLASS(wxVTKRenderWindowInteractor, wxWindow)
>  
> //BEGIN_EVENT_TABLE(wxVTKRenderWindowInteractor, WX_BASE_CLASS)
>   BEGIN_EVENT_TABLE(wxVTKRenderWindowInteractor, wxWindow)
> 
> Also, commented out pRenderer->Delete().  This kills the process, 
> but I get same problem with the MFC version. (Vtk: Dec 14 2002) 
>  
> void MyFrame::DestroyVTK()
> {
>   if (pRenderer != 0) { 
>     // pRenderer->Delete();  ! Note: skip this line 
>   } 
>   ... 
> } 
>  
> Nigel 
> PS: Mathieu, nice implementation! 
>  
>  
> 
>> Did you used my FindwxWindows.cmake
>>
>>http://www.creatis.insa-lyon.fr/~malaterre/cmake/FindwxWindows.cmake
>>
>>This set a lot of default flags for wxWindows (you'll find it 
>>also attached to this email).
>>
>>If you don't want to change the one shipped with CMake. Just create 
>>a directory under wxVTK: for example myCMakeModules
>>
>>Then open wxVTK/CMakeLists.txt
>>
>>Comment this line:
>>#FIND_PACKAGE(wxWindows)
>>
>>and add this line instead:
>>INCLUDE (${wxVTK_SOURCE_DIR}/myCMakeModules/FindwxWindows.cmake)
>>
>>rerun cmake, recompile and -hopefully- you should be all set.
>>
>>HTH
>>mathieu
>>
>>
>>>As you can see, the sample portion compiles just fine (no errors), 
>>>but when building the wxVTKRenderWindowInteractor, it spit up three 
>>>errors (one above, two very similar, three lines down associated 
>>>with the BEGIN_EVENT_TABLE macro), and 33 warnings (one above, all 
>>>complaining of inconsistent dll linkage, and dllexport assumed.
> 
>  
>  
> 
> **********************************************************************
> This message is intended for the addressee named and may contain 
> confidential and privileged information. If you are not the intended 
> recipient please note that any form of distribution, copying or use of
> this communication or the information in it is strictly prohibited and
> may be unlawful. If you receive this message in error, please delete it
> and notify the sender.
> 
> Keep up to date with what's happening in Australian sport.
> Visit http://www.ausport.gov.au
> **********************************************************************
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers





More information about the vtkusers mailing list