Unhandled exception at 0x7c422981 in vtk_minimal.exe: 0xC0000005: Access violati

limen Messages postés 1 Date d'inscription lundi 15 octobre 2007 Statut Membre Dernière intervention 17 avril 2008 - 17 avril 2008 à 15:40
luhtor Messages postés 2023 Date d'inscription mardi 24 septembre 2002 Statut Membre Dernière intervention 28 juillet 2008 - 17 avril 2008 à 18:50
Salut tout le monde,
J'essayes d'utiliser la bibliothèque VTK (Visualisation ToolKit) avec visual studio .NET 2005, je l'ai installé et compilé, tous marche bien.
Mais l'orsque j'ai essayé d'éxécuter un petit programme de teste j'ai eu l'erreur suivante:

Unhandled exception at 0x7c422981 in vtk_minimal.exe: 0xC0000005: Access violation writing location 0x00652493.

le code que j'ai mit est le suivant:
#include "project_config.h"

#include "vtkActor.h"
#include "vtkConeSource.h"
#include "vtkInteractorStyleTrackballCamera.h"
#include "vtkPolyDataMapper.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"

int main(int argc, char** argv[])
{
    //Create a cone source object

    vtkConeSource *cone = vtkConeSource::New();
    cone->SetHeight(3.0);
    cone->SetRadius(1.0);
    cone->SetResolution(10);

    //Create a cone mapper object

    vtkPolyDataMapper *coneMapper = vtkPolyDataMapper::New();
    coneMapper->SetInputConnection(cone->GetOutputPort());

    //Associate the cone mapper to an actor object

    vtkActor *coneActor = vtkActor::New();
    coneActor->SetMapper(coneMapper);

    //Add that actor to the renderer

    vtkRenderer *ren1 = vtkRenderer::New();
    ren1->AddActor(coneActor);
    ren1->SetBackground(0.1, 0.2, 0.4);

    //Create a render window

    vtkRenderWindow *renWin = vtkRenderWindow::New();
    renWin->AddRenderer(ren1);
    renWin->SetSize(300, 300);

    //Create an interactor and associate it to the render window

> vtkRenderWindowInteractor *iren vtkRenderWindowInteractor::New();
    iren->SetRenderWindow(renWin);
    //Define the interacting style

    vtkInteractorStyleTrackballCamera *style = vtkInteractorStyleTrackballCamera::New();
    iren->SetInteractorStyle(style);

    //Start to interact

    iren->Initialize();
    iren->Start();   

    return 0;
}

ça plante exactement là ou il ya la flèche

Sachant que la bibliothèque VTK utilise OpenGL.
Merci pour vos aides!!

1 réponse

luhtor Messages postés 2023 Date d'inscription mardi 24 septembre 2002 Statut Membre Dernière intervention 28 juillet 2008 6
17 avril 2008 à 18:50
J'y connais rien à vtk, mais il manque un genre de vtkInit quelque part ?
0
Rejoignez-nous