Compilation problem with intel c++-compiler and BRepPrimAPI_MakeCylinder

I have compiled Open CASCADE with vs 2005.
My projects runs well under vs 2005.
But if i activate the intel c++-compiler i get some compiler errors.

TopoDS_Shape sp = BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(-a1/2.0,z0,x0),gp_Dir(1,0,0)),r,a1);

is not compiled. I get the error:
Error 12 error: no suitable user-defined conversion from "BRepPrimAPI_MakeCylinder" to "TopoDS_Shape" exists

But
TopoDS_Shape so = BRepPrimAPI_MakeBox(gp_Ax2(gp_Pnt(-a/2.0,-b/2.0,0),gp_Dir(0,0,1)),a,b,len);
is compiled without any problems.

I only have problems with BRepPrimAPI_MakeCylinder.

Any ideas to solve this problem?

Albert Woo's picture

I have the same problem. The version of Intel Compiler I use is V8.1, and my projects run under VC6.

Thornton's picture

This seems to be a bug in the intel compiler. This should be a workaround.
Replace two lines in BRepPrimAPI_MakeOneAxis.hxx
//! Returns the lateral face of the rotational primitive.
//!
Standard_EXPORT const TopoDS_Face& Face() ;
//Standard_EXPORT operator TopoDS_Face();
Standard_EXPORT operator TopoDS_Face() const;

//! Returns the constructed rotational primitive as a shell.
Standard_EXPORT const TopoDS_Shell& Shell() ;
//Standard_EXPORT operator TopoDS_Shell();
Standard_EXPORT operator TopoDS_Shell() const;

Now i was able to compile my project. It crashes directly after start but this could have another reason.
Maybe it works for you. Please let my know if you succeeded.