Compilation of Extended SDK C++ SDK will halt on macOS for SDKs older than 2024.4.0
-
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.
-
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 -
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:
- Download SDK 2024.0.2 C++ sdk from the sdk downloads page.
- Extracted it to my downloads folder.
- Ran ./generate_solution_osx.command
- Opened ./solution_osx.command
- Changed build system to legacy, schema to AllTargets, and tried to build
Ran into the same issue here:
-
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 -
Thanks for looking into this Ferdinand and have a great evening!
-
-
Hello @kitbash_ave,
so, I had a look, and we ship extended legacy SDKs with incorrect line endings for the files
ccache-clang.sh
andccache-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
. The2024.4.0
,2024.5.0
, and most importantly2025.0.0
extended SDK are not affected by this. Thesdk.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
for2023.0.1
andExtended 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
andccache-clang++.sh
and set the line endings toLF
. 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,
FerdinandVideo
Here I explain this a bit try subject in a more tangible way:
-
Exactly the problem Ferdinand, thanks for the speedy fixes! Successfully building on 2024.0.2 and 2023.0.1 sdks.
-Avery -
Hey everyone,
I fixed the issue, the legacy SDKs now have again the correct line endings, the downloads have been updated.
Cheers,
Ferdinand