Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

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

    Cinema 4D SDK
    2
    6
    1.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      steve_r
      last edited by

      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"
      #else
      #include "c4d_misc/datastructures/delegate.h"
      #endif
      

      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?

      1 Reply Last reply Reply Quote 0
      • r_giganteR
        r_gigante
        last edited by r_gigante

        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

        S 1 Reply Last reply Reply Quote 2
        • S
          steve_r @r_gigante
          last edited by

          @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 😉

          1 Reply Last reply Reply Quote 0
          • r_giganteR
            r_gigante
            last edited by

            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

            S 1 Reply Last reply Reply Quote 3
            • S
              steve_r @r_gigante
              last edited by

              @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.

              r_giganteR 1 Reply Last reply Reply Quote 0
              • r_giganteR
                r_gigante @steve_r
                last edited by

                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

                1 Reply Last reply Reply Quote 2
                • First post
                  Last post