
Thu, 07/18/2013 - 20:55
Forums:
Hi,
I have a problem with BRepTools::Read using an istream:
The following line works perfect. So far so good.
TopoDS_Shape ashape;
BRep_Builder B1;
Standard_Boolean result = BRepTools::Read(ashape,"D:/test/edge.brep",B1);
I copied the follwing lines from the code of BRepTools::Read
BRep_Builder B;
filebuf fb;
istream in(&fb);
fb.open("D:/test/edge.brep", ios::in)
BRepTools_ShapeSet SS(B);
SS.SetProgress(NULL);
SS.Read(in);
Ang here the function crashes at SS.Read. I even cant examine wich kind of exception is thrown. I tried it with several brep files, always the same result.
I can´t understand the reason, because both cases use the same functions.
Any help would be apreciated
Regards,
Joachim
Fri, 07/19/2013 - 11:56
Did you compile your Project with the same compiler the Open Cascade Library has been built with?
Passing an istream to a library which has been built with another compiler-version of the c++-library can cause a problem.
Fri, 07/19/2013 - 12:58
Thanks for that hint. You might be right! My Project is compiled with VS11 but the OCC library is still a VS9 compilation. I will check that!
Mon, 07/22/2013 - 13:49
using the same Compiler finaly solved the problem! Thanks!