Preprocessor macro to get Open CASCADE version?

Is there a header file that defines what version of the Open CASCADE library is being used? In most software libraries this is done with some sort of number so you can test version numbers and put in version-dependent code.

For example, I'd like to put the following in my code:

#include

#ifdef OCC_VERSION > 0510
// Need to fix missing symbol in Open CASCADE 5.1
// But this header file doesn't exist in older versions.
#include
Standard_EXPORT Handle_BOP_HistoryCollector::~Handle_BOP_HistoryCollector() {}
#endif

I think there is no such symbol (I searched the "inc" directory for "5" and didn't get any likely hits), in which case please consider this a "feature request" for the next version.

Thanks!

-- Conrad

c-poelman's picture

P.S. After posting this message, I found http://www.opencascade.com/community/forum/thread_5102/ which explains the real solution to the specific problem I was having with the missing symbol. Thanks Patrik!

So I don't urgently need an OCC_VERSION macro, but it still seems like a good idea in general - most commercial or large open source libraries that I've worked with have such symbols so you can make your single code base work across differences in versions of your libraries.

-- Conrad

Forum supervisor's picture

Hello Conrad,

Since version 5.0 there is a file Standard_Version.hxx that includes the version-related macros. They all begin with OCC_VERSION. Consult the file for details, it's pretty self-explaining.

Best regards,
Forum supervisor

c-poelman's picture

Thanks!

-- Conrad