Re-build plugin for R20 - missing file "delegate.h"

  • Hi,
    when trying to recompile a plugin for R20 using the latest "cinema.framework" I get a "missing file" error (on Mac):

    /frameworks/cinema.framework/source/c4d_customgui/customgui_description.h:15:10: 'c4d_misc/datastructures/delegate.h' file not found

    This file is referenced from other R20 SDK's includes. Indeed, such a file does NOT exist at that location. The parent include looks like this:

    #ifdef USE_API_MAXON
    #include "maxon/delegate.h"
    #include "c4d_misc/datastructures/delegate.h"

    I have not defined USE_API_MAXON in my build because I don't use the new maxon API. Defining it anyways gives me tons of syntax errors due to old R19 code.
    Any hints?

  • Hi steve_r,

    it seems like you're attempting to create hybrid plugins mixing classic API with new API. Could you please check that C4D=true is actually used in your projectdefinition.txt as reported in the Project Tool section of the C++ API docs?

    Best, Riccardo

  • @r_gigante No, the C4D=true was not set in the project file. Once I added it I noticed that it also enables USE_API_MAXON, and now I get tons of R19 syntax errors back! Seems there is no way around fixing those (which I was thinking in the first place ;)

  • Hi steve_r,

    porting pre-R20 plugins to R20 definitively requires to review the code and deliver the changes needed to make it nicely work with the new API structure and syntax.
    I warmly suggest to run through all of them and fix accordingly to what stated on the Plugin Migration section of the Cinema API C++ documentation.

    Last but not least, consider that a few of the issue might be due to code-style strictness level: in such case you can consider to lower the code-style strictness (see style-check) for an initial transition and concentrate on design issues.

    Best, Riccardo

  • @r_gigante I wonder, is it REQUIRED to set USE_API_MAXON in my project when re-compiling old plugins for R20? It seems that, if not set, certain #includes from cinema.framework do not compile.

  • Hi Steve,

    having the USE_MAXON_API being defined - actually using C4D=true in projectdefinition.txt - is required in order to be sure that all the cinema.framework classes are properly compiled. Although there could be situations where some cinema.framework classes can work without that define, we highly discourage this approach since you can end up in situations where the code compiles until you include that specific class which indeed needs that define (which it's already happening in that case).

    If specifying C4D=true actually brings too much pain, please open a new thread and let's proactively discuss the issues your code is facing and let's get rid of them.

    Best, Riccardo