2017-05-09 2 views
0

Sur la construction de mon code avec VTK 7.0 avec Qt5.7 et 4,5 et ITK dans Visual Studio 2013, je reçois l'erreur suivante:VTK/ITK/QT - erreur de symbole externe non résolu (LNK2001)

erreur LNK2001 : symbole externe non résolu "protégé: virtual void __cdecl vtkVRMLSource2 :: SetNthOutput (int, classe vtkDataObject *)" (? SetNthOutput @ vtkVRMLSource2 @@ MEAAXHPEAVvtkDataObject @@@ Z)

Le code correspondant à ce fichier est ce (`vtkVRMLSource2.cxx``):

#include "vtkVRML.h" 
#include "vtkVRMLSource2.h" 
#include "vtkVRMLImporter.h" 
#include "vtkObjectFactory.h" 
#include "vtkPolyData.h" 
#include "vtkProperty.h" 
#include "vtkActorCollection.h" 
#include "vtkActor.h" 
#include "vtkPointData.h" 
#include "vtkCellData.h" 
#include "vtkPolyDataMapper.h" 
#include "vtkRenderer.h" 
#include "vtkTransformPolyDataFilter.h" 
#include "vtkAppendPolyData.h" 
#include "vtkTransform.h" 
#include "vtkUnsignedCharArray.h" 
#include "vtkSmartPointer.h" 
#include "vtkFloatArray.h" 
#include "vtkDataObject.h" 
#include <stdio.h> 
#include <iostream> 
..... 
idx = 0; 
while ((actor = actors->GetNextActor())) 
{ 
mapper = vtkPolyDataMapper::SafeDownCast(actor->GetMapper()); 
if (mapper) 
    { 
    //mapper->GetInput()->Update(); 
    //vtkPolyData *newOutput = vtkPolyData::New(); 
    vtkPolyData *newOutput = mapper->GetInput(); 
    //newOutput->CopyInformation(mapper->GetInput()); 
    this->SetNthOutput(idx, newOutput); 
    ++idx; 
    newOutput->Delete(); 
    newOutput = NULL; 
    } 
} 

Et le fichier vtkVRMLSource2.h est:

#include "vtkAlgorithm.h" 
#include "vtkDataObject.h" 
class vtkVRMLSource2 : public vtkAlgorithm{ 

public: 
int vtkTypeRevisionMacro(vtkVRMLSource2, vtkAlgorithm); 
void PrintSelf(ostream& os, vtkIndent indent); 
static vtkVRMLSource2 *New(); 
int NumberOfOutputs; 

vtkSetStringMacro(FileName) 
vtkGetStringMacro(FileName) 

int GetNumberOfOutputs(); 
vtkPolyData* GetOutput(int idx); 
vtkPolyData* GetOutput() { return this->GetOutput(0);} 

vtkSetMacro(Color,int) // usage example: this->SetColor(1); 
vtkGetMacro(Color,int) 
vtkBooleanMacro(Color,int) 

vtkSetMacro(Append,int) // usage example: this->SetAppend(1); 
vtkGetMacro(Append,int) 
vtkBooleanMacro(Append,int) 

protected: 
vtkVRMLSource2(); 
~vtkVRMLSource2(); 

void Execute(); 
void InitializeImporter(); 
void CopyImporterToOutputs(); 

char* FileName; 
vtkVRMLImporter *Importer; 
int Color; 
int Append; 

virtual void SetNthOutput(int num, vtkDataObject *output); 
private: 
    vtkVRMLSource2(const vtkVRMLSource2&); 
    void operator=(const vtkVRMLSource2&); 
}; 

je lié tous les VTK appropriés, les bibliothèques Qt ITK et VS. Pourriez-vous s'il vous plaît me contacter?

+3

Selon [ce] (https://www.visitusers.org/index.php?title=VTK_6.0_Upgrade), vous devez changer ' this-> SetNthOutput (idx, newOutput) 'à' this-> GetExecutive() -> SetOutputData (idx, newOutput) ' – putu

Répondre

0

Vous devez fournir la définition de void SetNthOutput(int num, vtkDataObject *output) que vous avez déclarée dans votre fichier d'en-tête. Vous pouvez le faire en ajoutant ceci à vtkVRMLSource2.cxx:

void vtkVRMLSource2::SetNthOutput(int num, vtkDataObject *output) 
{ 
    //code goes here 
}