TDocStd_Application::NewDocument error

I'm using XCAF to create a STEP file but I got a segmentation violation when I tried to create a new document. My code is:

Handle(TDocStd_Document) aDoc;
Handle (XCAFApp_Application)A = XCAFApp_Application::GetApplication();
A->NewDocument (TCollection_ExtendedString ("MDTV-XCAF"),aDoc);
Handle(XCAFDoc_ShapeTool) myAssembly =

When I try to execute it I get:

#8 0x00002b654de2b7c4 in Handle_Standard_Transient::EndScope() () from /home/cinzia09/OpenCASCADE/ros/lib/
#9 0x000000001ca43760 in ?? ()
#10 0x00002b654de2b85c in Handle_Standard_Transient::Assign(Standard_Transient const*) () from /home/cinzia09/OpenCASCADE/ros/lib/
#11 0x000000001e9bf008 in ?? ()
#12 0x00007fff38713f30 in ?? ()
#13 0x000000001e9bf008 in ?? ()
#14 0x00002b654eecea44 in TDocStd_Application::NewDocument(TCollection_ExtendedString const&, Handle_TDocStd_Document&) ()

Could someone say me what's wrong in my code?
Thank you


Cinzia3's picture

Hi All again,
I'm still looking for a solution. I guess that the problem is in the libTKernel library so I think that it can be an OpenCascade bug. Could someone help me to understand??