derived class produces dll linkage error?

Lawrence M. Lifshitz Lawrence.Lifshitz at umassmed.edu
Tue May 16 16:15:12 EDT 2000


hi. I am trying to extend the vtkImageReader class to read
my own image format (i2i).  I seem to have a problem linking
with vtkdll.lib.  I am working on Win98/VC++6, using the precompiled
libraries.  I have had no problem linking with this library to
run several of the demo programs, which don't try to derive a new
class.  So I am thinking that the difference has to do with the
fact that I am trying to derive a class.  The message I get for
each method is (for the New method, similar messages for other methods):

vtki2ireader.cxx(54) : warning C4273: 'New' : inconsistent dll linkage. 
dllexport assumed.


The relevant snippet of code is:
.h file:
#include "vtkImageReader.h"

class VTK_EXPORT vtkI2IReader : public vtkImageReader
{
public:
  static vtkI2IReader *New();
  ...
}

.cxx file:
vtkI2IReader* vtkI2IReader::New()


does it not realize I am doing "implicit" linking using the vtkdll.lib
to import from
vtk.dll, and therefore it mangles (decorates?) methods incorrectly? 
when it says
"dllexport" assumed, does that mean it thinks I'm trying to create a
library?
should I just ignore the warning?  does VC++ require anything different
for generic derived
classes (all the docs I've seen talk about MFC based derived classes)?

Any pointers would be helpful!

	Larry

-- 
Lawrence M. Lifshitz, Ph.D.	    
Biomedical Imaging Group - University of Massachusetts Medical School
Phone: (508) 856-3392  	   email:    Lawrence.Lifshitz at umassmed.edu
FAX: (508) 856-1840	   web:	     http://invitro.umassmed.edu/~lml
--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list