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

    Compilation of Extended SDK C++ SDK will halt on macOS for SDKs older than 2024.4.0

    Bugs
    c++ macos
    2
    8
    2.0k
    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.
    • K
      kitbash_ave
      last edited by ferdinand

      Hello!

      I'm running into the following build error when building my plugin using the 2024.0.2 sdk. When I build with the 2024.5 sdk my plugin builds fine, but I'd like to support as many versions of C4D as possibe.

      error: can't exec '../../../frameworks/settings/ccache-clang.sh' (No such file or directory)
      Command ../../../frameworks/settings/ccache-clang.sh failed with exit code 71
      

      I've confirmed the file is at the location being searched for.

      Configuration:
      Error occurred while building core.framework.
      Building on macOS Monterey 12.7.6 with Xcode 13.4.1 utilizing legacy build system.

      Additionally I attempted to build with the 2023.0 SDK and had the same error.

      Avery Stauber
      3D Graphics Pipeline Engineer - Kitbash3D

      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @kitbash_ave
        last edited by ferdinand

        Hey @kitbash_ave,

        Welcome to the Maxon developers forum and its community, it is great to have you with us!

        Getting Started

        Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules.

        • Forum Overview: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment.
        • Support Procedures: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support.
        • Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads.

        It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: Asking Questions.

        About your First Question

        You are likely ignoring this warning from out Getting Started: First Steps manual:

        Once you have unpacked an SDK on Windows you cannot use it on macOS without resetting its file permissions. An SDK unpacked under macOS can always be migrated to Windows. Such 'tainted Windows SDK' might fail to compile on macOS.

        What the warning does not mention, is that unpacking the SDK on Windows will also often screw up your line endings. In our SDK package generator we have therefore a section where we reset the line endings to Linux style inside the zip package for exactly these two shell scripts (as the generators usually run on Windows machines). Once you unpack the SDK, Windows/the zip tool will usually enforce Windows style line endings. The easiest way for you to fix this, is to download a matching extended SDK, then unpack it on macOS, and replace the frameworks from that SDK with your tainted frameworks. Technically you could also just update the two shell scripts used by XCode's Clang but I would advise against piecing together an SDK from multiple sources, as this can easily lead to problems.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • K
          kitbash_ave
          last edited by

          Hey Ferdinand! Great to be here, and thanks for the super fast response. 🚀

          Currently I was testing only on a macOS machine. Just to double check I didn't bork anything I just did the following steps to try again all on macOS:

          1. Download SDK 2024.0.2 C++ sdk from the sdk downloads page.
          2. Extracted it to my downloads folder.
          3. Ran ./generate_solution_osx.command
          4. Opened ./solution_osx.command
          5. Changed build system to legacy, schema to AllTargets, and tried to build
            Ran into the same issue here:

          image.png

          Avery Stauber
          3D Graphics Pipeline Engineer - Kitbash3D

          ferdinandF 1 Reply Last reply Reply Quote 0
          • ferdinandF
            ferdinand @kitbash_ave
            last edited by ferdinand

            Hey @kitbash_ave,

            I will give it a spin tomorrow, to see what is what. Your steps are correct, and you are using the correct OS and XCoode.

            Cheers,
            Ferdinand

            MAXON SDK Specialist
            developers.maxon.net

            1 Reply Last reply Reply Quote 0
            • K
              kitbash_ave
              last edited by

              Thanks for looking into this Ferdinand and have a great evening!

              Avery Stauber
              3D Graphics Pipeline Engineer - Kitbash3D

              1 Reply Last reply Reply Quote 0
              • ferdinandF ferdinand moved this topic from Cinema 4D SDK on
              • ferdinandF
                ferdinand
                last edited by ferdinand

                Hello @kitbash_ave,

                so, I had a look, and we ship extended legacy SDKs with incorrect line endings for the files ccache-clang.sh and ccache-clang++.sh. This is a bug and I therefore moved this topic to the bug forum and also slightly modified the title.

                Legacy SDKs means all SDKs to which we applied the extended SDK retroactively, i.e., everything before 2024.4.0. The 2024.4.0, 2024.5.0, and most importantly 2025.0.0 extended SDK are not affected by this. The sdk.zip shipped with a Cinema 4D installation was never affected by this.

                We will fix this in a timely manner, as this is a critical bug, but I have to fix the package generation for the legacy SDKs for that (I probably forgot there the step to sanitize line endings) and doing that will probably take me at least a few days. So, for now we must ask you to fix this yourself.

                ⚠ Do not overwrite these files with files you have sourced from another SDK. Doing this within a perfect version match, e.g., sdk.zip for 2023.0.1 and Extended SDK 2023.0.1 is fine but these files do change over time and you will break things if you mismatch them.

                Option 1

                Simply navigate towards {EXTENDED_SDK}/frameworks/settings/ccache-clang.sh and ccache-clang++.sh and set the line endings to LF. I also show in the video how to do this with VS Code as an example editor.

                Option 2

                Alternatively you could also write a little shell script which does this for you. This can be useful if you want to automate this for multiple SDKs. I also showcase how to do this in the video, my script I provided below expects to be placed in a subdirectory of the SDK, e.g. {EXTENDED_SDK}/tools/fix_line_endings.sh.

                #!/bin/bash
                # Enforces LF line endings for the two clang cache scripts in the Cinema 4D SDK.
                #
                # Expects to be placed in the tools directory of the Extended Cinema 4D SDK.
                
                TARGET_DIR="../frameworks/settings"
                FILES=("ccache-clang.sh" "ccache-clang++.sh")
                
                if [ ! -d "$TARGET_DIR" ]; then
                  echo "Target directory $TARGET_DIR does not exist."
                  exit 1
                fi
                
                for filename in "${FILES[@]}"; do
                  file="$TARGET_DIR/$filename"
                  path=$(realpath "$file")
                  if [ -f "$file" ]; then
                    sed -i '' 's/\r$//' "$file" # Convert CRLF to LF
                    sed -i '' 's/\r//' "$file" # Convert CR to LF
                    echo "Enforced LF line endings for $path."
                  else
                    echo "The file $path does not exist, you are running this script on an irregular C++ SDK."
                  fi
                done
                

                I hope this help and cheers,
                Ferdinand

                Video

                Here I explain this a bit try subject in a more tangible way:

                MAXON SDK Specialist
                developers.maxon.net

                1 Reply Last reply Reply Quote 2
                • K
                  kitbash_ave
                  last edited by

                  Exactly the problem Ferdinand, thanks for the speedy fixes! Successfully building on 2024.0.2 and 2023.0.1 sdks.
                  -Avery

                  Avery Stauber
                  3D Graphics Pipeline Engineer - Kitbash3D

                  1 Reply Last reply Reply Quote 0
                  • ferdinandF
                    ferdinand
                    last edited by

                    Hey everyone,

                    I fixed the issue, the legacy SDKs now have again the correct line endings, the downloads have been updated.

                    Cheers,
                    Ferdinand

                    MAXON SDK Specialist
                    developers.maxon.net

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