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

    GePrint no longer works?

    Cinema 4D SDK
    4
    11
    1.5k
    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.
    • R
      rui_mac
      last edited by

      My old (pre s22) plugins used GePrint to print to the console.
      Now, when I'm trying to update them, I get an error in the lines with GePrint, telling me "No matching function for call to 'GePrint'".
      And nothing more. No more information!! Nothing.
      So, how can we print to the console now?
      I performed a search in the forum but all the posts with GePrint are older than 5 years.

      1 Reply Last reply Reply Quote 0
      • S
        spedler
        last edited by

        The only problem I've had with GePrint calls when converting older plugins is that formerly you could do this:

        GePrint("Print this string...");
        

        But now you have to do this:

        GePrint(String("Print this string..."));
        

        That might be causing the issue, though the error I was getting isn't the one you mentioned. Worth a try though.

        Steve

        1 Reply Last reply Reply Quote 0
        • C4DSC
          C4DS
          last edited by

          If I remember correctly, most strings now need to be of type maxon::String. Can't remember in which version this was introduced (and that doesn't really matter).
          Since then you could be using suffix _s
          GePrint("Print this string..."_s);

          There are different ways to output to the console, but I am now mainly using ApplicationOutput.

          Wasn't this listed in one of the "API Changes in Rxx"?

          1 Reply Last reply Reply Quote 0
          • M
            m_adam
            last edited by m_adam

            Hi @rui_mac correct GePrint being deprecated I would recommend you to stop using it and use the new maxon counter part I'm going to explain later in this post. Regarding type, this is correct there is the type String and maxon::String one is the old String and the other is the new one more optimized and future proof. As said by C4DS you can create the last one with maxon::String("xxx") or even with the "xxx"_s suffix. For more information please read C++ SDK - Conversion To String.

            Regarding logging, I really advise you to use the maxon one as they are threadsafe and all support the formatString, for more information on that see Output Syntax.

            The output to the console can be filtered by setting the configuration variables g_diagnostic, g_warning and g_critical to true or false
            For more info see Debug and Output Functions.

            • maxon::ApplicationOutput (formatString)
              • Visible in Application Console
              • Used to communicate information to the user.
            • maxon::DiagnosticOutput (formatString)
              • Visible in debug builds or in a release build when the debug console with diagnostic output is activated
              • Report information about current algo progress, memory state, etc
            • maxon::DiagnosticVarOutput (...)
              • Use maxon::DiagnosticOutput, to outputs the values of variables into the console.
              • DiagnosticVarOutput(x, _y, v.z); will output "x: 42, _y: 99, v.z: 0".
            • maxon::WarningOutput (formatString)
              • Visible in debug builds or in a release build when the debug console with warning output is activated.
              • Unexpected but non-critical issue (e.g. bad user input)
            • maxon::CriticalOutput (formatString)
              • Visible in debug builds or in a release build when the debug console with critical output is activated.
              • Only do when something critical happens (e.g. failed module init, failed memory alloc, illegal array access)
            • maxon::DebugOutput (flags, formatString)
              • Only effect in debug builds and does not cost any time in release builds. Flags argument is a value of maxon::OUTPUT, this specify which logger to use (diagnostic, warning, critical).
              • Used for temporary output that must not be visible to a customer or external developer
            • maxon::OutputWithFlags( flags, formatString)
              • The output is visible in debug builds or in a release build when the debug console. Flags argument is a value of maxon::OUTPUT, this specify which logger to use (diagnostic, warning, critical).

            The next one are deprecated and should not be used in new code (they are rerouting to previous output).

            • GePrint(const maxon::String& str)
              • Deprecated, use maxon::ApplicationOutput
            • GeConsoleOut(const maxon::String& str)
              • Deprecated, use maxon::DiagnosticOutput

            Cheers,
            Maxime.

            MAXON SDK Specialist

            Development Blog, MAXON Registered Developer

            R 1 Reply Last reply Reply Quote 0
            • R
              rui_mac @m_adam
              last edited by

              I tried using all the solutions that you guys presented (one at a time, of course) and, all of a sudden, I got all these errors!!!

              Screenshot 2022-09-02 at 13.00.13.png

              1 Reply Last reply Reply Quote 0
              • M
                m_adam
                last edited by m_adam

                Just to be sure are you using the Legacy Build system located in "File" / "Project Settings" / "Section Shared Project Settings/Build System" / "Legacy Build System"?

                MAXON SDK Specialist

                Development Blog, MAXON Registered Developer

                R 1 Reply Last reply Reply Quote 0
                • R
                  rui_mac @m_adam
                  last edited by

                  @m_adam, I still get the same errors 😞

                  1 Reply Last reply Reply Quote 0
                  • M
                    m_adam
                    last edited by

                    Would it be possible for you to send us your project files, if you don't want to do that publicly you can send them to [email protected].

                    Cheers,
                    Maxime.

                    MAXON SDK Specialist

                    Development Blog, MAXON Registered Developer

                    R 1 Reply Last reply Reply Quote 0
                    • R
                      rui_mac @m_adam
                      last edited by

                      @m_adam, thank you. I will send the files to the e-mail you provided.

                      1 Reply Last reply Reply Quote 0
                      • M
                        m_adam
                        last edited by m_adam

                        Hi here I was able to compile without issue on windows with MSVC 2019 16.11.18 and on mac OS 11.3 and Xcode: 12.5.1.
                        What I did was:

                        • Extract the sdk.zip from latest S26 version
                        • Extract your plugin to the plugin folder
                        • Edit plugins/project/projectdefinition.txt to include your project.
                        • Run the project tool
                        • Open the IDE and compile in Debug and Release.

                        So since this is not the code it's something to do with the setup. Are you able to compile on windows? Which version of mac OS are you using? Which version of Xcode are you using? Do you have a m1? Frameworks can't be copied from windows to mac (the other way is possible) so are you using the frameworks from a Cinema 4D for mac? Which version of Cinema 4D are you targeting?

                        Cheers,
                        Maxime.

                        MAXON SDK Specialist

                        Development Blog, MAXON Registered Developer

                        1 Reply Last reply Reply Quote 0
                        • M
                          m_adam
                          last edited by

                          Hello @rui_mac,

                          without further questions or postings, we will consider this topic as solved by Wednesday 31/05/2023 and flag it accordingly.

                          Thank you for your understanding,
                          Maxime.

                          MAXON SDK Specialist

                          Development Blog, MAXON Registered Developer

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