Can't compile my code after upgrade to 5.2

I have upgraded from 5.1 to 5.2. My occ-program was running well with OCC 5.1. But since I've upgraded I can't compile any more. I get the errors shown below.
I think it has something to do with STL streams!? What changes in my code do I have to make while upgrading?

-------
*In file included from /opt/OpenCASCADE5.2/ros/inc/Standard_TypeMismatch.hxx:33,
*from /opt/OpenCASCADE5.2/ros/inc/TopoDS.lxx:9,
*from /opt/OpenCASCADE5.2/ros/inc/TopoDS.hxx:155,
*from unitcellcadmodel.h:20,
*from unitcellcadmodel.cpp:9:
*/opt/OpenCASCADE5.2/ros/inc/Standard_SStream.hxx:37: error: Syntaxfehler before `{' token
*/opt/OpenCASCADE5.2/ros/inc/Standard_SStream.hxx:41: error: Syntaxfehler before `&' token
*/opt/OpenCASCADE5.2/ros/inc/Standard_SStream.hxx:42: error: destructors must be member functions
*/opt/OpenCASCADE5.2/ros/inc/Standard_SStream.hxx:43: error: Syntaxfehler before `}' token
*In file included from /opt/OpenCASCADE5.2/ros/inc/Standard_DomainError.hxx:38,
*from /opt/OpenCASCADE5.2/ros/inc/Standard_TypeMismatch.hxx:38,
*from /opt/OpenCASCADE5.2/ros/inc/TopoDS.lxx:9,
*from /opt/OpenCASCADE5.2/ros/inc/TopoDS.hxx:155,
*from unitcellcadmodel.h:20,
*from unitcellcadmodel.cpp:9:
*/opt/OpenCASCADE5.2/ros/inc/Standard_Failure.hxx:78: error: `aReason' was not declared in this scope
*/opt/OpenCASCADE5.2/ros/inc/Standard_Failure.hxx:78: error: invalid data member initialization
*/opt/OpenCASCADE5.2/ros/inc/Standard_Failure.hxx:78: error: (use `=' to initialize static data members)
*/opt/OpenCASCADE5.2/ros/inc/Standard_Failure.hxx:78: error: variable or field ` Raise' declared void
*/opt/OpenCASCADE5.2/ros/inc/Standard_Failure.hxx:78: error: declaration of `int Standard_Failure::Raise'
*/opt/OpenCASCADE5.2/ros/inc/Standard_Failure.hxx:77: error: conflicts with previous declaration `static void Standard_Failure::Raise(char*)'
*In file included from /opt/OpenCASCADE5.2/ros/inc/Standard_TypeMismatch.hxx:38,
*from /opt/OpenCASCADE5.2/ros/inc/TopoDS.lxx:9,
*from /opt/OpenCASCADE5.2/ros/inc/TopoDS.hxx:155,
*from unitcellcadmodel.h:20,
*from unitcellcadmodel.cpp:9:
*/opt/OpenCASCADE5.2/ros/inc/Standard_DomainError.hxx:65: error: `aReason' was not declared in this scope
*/opt/OpenCASCADE5.2/ros/inc/Standard_DomainError.hxx:65: error: invalid data member initialization
*/opt/OpenCASCADE5.2/ros/inc/Standard_DomainError.hxx:65: error: variable or field `Raise' declared void
*/opt/OpenCASCADE5.2/ros/inc/Standard_DomainError.hxx:65: error: declaration of `int Standard_DomainError::Raise'
*/opt/OpenCASCADE5.2/ros/inc/Standard_DomainError.hxx:64: error: conflicts with previous declaration `static void Standard_DomainError::Raise(char*)'
*In file included from /opt/OpenCASCADE5.2/ros/inc/TopoDS.lxx:9,
*from /opt/OpenCASCADE5.2/ros/inc/TopoDS.hxx:155,
*from unitcellcadmodel.h:20,
*from unitcellcadmodel.cpp:9:
*/opt/OpenCASCADE5.2/ros/inc/Standard_TypeMismatch.hxx:65: error: `aReason' was not declared in this scope
*/opt/OpenCASCADE5.2/ros/inc/Standard_TypeMismatch.hxx:65: error: invalid data member initialization
*/opt/OpenCASCADE5.2/ros/inc/Standard_TypeMismatch.hxx:65: error: variable or field `Raise' declared void
*/opt/OpenCASCADE5.2/ros/inc/Standard_TypeMismatch.hxx:65: error: declaration of `int Standard_TypeMismatch::Raise'
*/opt/OpenCASCADE5.2/ros/inc/Standard_TypeMismatch.hxx:64: error: conflicts with previous declaration `static void Standard_TypeMismatch::Raise(char*)'
.... and so on....

Rob Bachrach's picture

I had a similar problem. It seemed to stem from the fact that I
used "configure" to build 5.2. I did the following to fix it:
- make sure the generated config.h file is in your cascade include directory
- add -DHAVE_CONFIG_H to your compiler settings

This causes the stream header files (and others) to configure
correctly for your system.