Compatibility issue with addon

I’m developping an addon that works fine with oF v0.8.3 but doesn’t work with v0.9.0 because of a method that uses a deprecated function. So I rewrote this method to work with v0.9.0. The question is: how do I make my addon work with both versions?
Thanks in advance!

You can use OF_VERSION_MAJOR, OF_VERSION_MINOR and OF_VERSION_PATCH. Then use #if blocks to use different code like:

// version 9 code
// version 8 code 
ofLogError() << "Unsupported OF version";

Notice v0.9.0 isn’t released yet, so values at master are still v0.8.4… but I’m guessing you can check the patch instead of minor number.


Perfect! Thank you very much!

1 Like