Compiling the Cinema 4D R20 C++ SDK Examples

Compiling the Cinema 4D R20 C++ SDK Examples


I've been developing Cinema 4D plugins using the Python API for a long time, and have attempted (but often struggled) to do development with Cinema 4D's C++ API. One of my biggest stumbling blocks was just getting the example plugins to compile. So, in this post, I'm going to try and catalog the steps I've taken to get this working.


I'm making extensive use of the Cinema 4D C++ SDK Documentation, and it should be seen as the definitive source of the information I'm providing in a simplified format here. Specifically, I found the following pages/articles quite helpful:


I am by no means an expert, and I will likely not be approaching things in the best/most correct way. If you know of a better way to do something, or if I'm sharing incorrect info, please correct me!


Modern programming relies on a complex of interconnected tools to do anything mildly useful. Some things that work great with one version of a tool, just won't work in the next version. So, I can only promise that this works with the exact setup I'm running, and if you find a workaround due to a difference in your setup, please post it.

Unzip and Point Cinema 4D to the SDK

  1. Locate in your Cinema 4D installation directory.
    • Note: This is different from the SDK Examples GitHub Repo as it includes a critical frameworks directory.
    • If you don't have I think the only way to get it is to reinstall Cinema 4D.
    • I recommend keeping a backup of this .zip file somewhere.
  2. Duplicate into a path that is easy to access via terminal. e.g. C:\
    • I'm duplicating the .zip to avoid accidentally deleting it as it's hard to recover a clean version without a reinstall of C4D.
    • You may need admin rights on your machine to do this.
  3. Unzip the SDK to C:\sdk.
  4. Open Cinema 4D
  5. Edit > Preferences > Plugins
  6. Go to the Plugins tab and add the C:\sdk\plugins folder.
    Plugin Paths
    • Unlike previous version of Cinema 4D, R20 lets you point to multiple plugins directory, making development much simpler.

If you restart Cinema 4D at this point, you may be disappointed to discover that no new plugins have shown up. That's because we need to...

Generate a Visual Studio Project

In previous versions of C4D you would have to have a keen understanding of Visual Studio to setup a project from scratch, or the patience to duplicate an existing working project and then rip out everything that doesn't do what you need. Maxon has provided a really great new tool that allows you to build a working Visual Studio project file from a single source directory so long as it includes a specifically named and formatted .txt file.

  1. Download the latest version of the C++ Project Tool from
  2. Unzip the project tool to C:\projecttool, ensure that this directory contains the actual project tool and libs, not just another nested folder.
    Project Tool Directory
  3. Open the command prompt (Windows Key, then type "command", and hit enter).
  4. In the command prompt, type
    1. cd c:\projecttool
    2. kernel_app_64bit.exe g_updateproject=C:\sdk
      Project Tool Commands
  5. This should launch the project tool and build a project file for the contents of C:\sdk
  6. Press return.
  7. In your file browser, navigate to and open C:\sdk\plugins\project\. If everything worked as expected, you should now see a file called plugins.sln

You've now created a Visual Studio project file that could be used to compile your project. But there's still more we have to do.

Add v140 Support to VC++

  1. In your file browser, navigate to and open C:\sdk\plugins\project\plugins.sln
  2. When you open it, you will likely discover a message that looks like this:
    This indicates that the project file doesn't match the latest and greatest from Microsoft. That's because the project was built for Visual Studio 2015, and we're using Visual Studio 2017. We'll need to modify our Visual Studio installation.
  3. Hit Cancel and Quit Visual Studio.
  4. Press the Windows key and search for "Visual Studio Installer".
  5. Run the Installer.
  6. Press Yes if prompted to allow changes to your computer.
  7. Click on the Modify button.
  8. Click on the Individual Components tab.
  9. Scroll down and check the VC++ 2015.3 v14.00 (v140) toolset for desktop option under the Compilers, Build Tools, and Runtimes header.
  10. Click on the Modify button in the lower right.
  11. Allows the installation to complete - it could take a while, this is roughly 5gb of additional downloads.

Build the Project

  1. In your file browser, navigate to and open C:\sdk\plugins\project\plugins.sln
  2. Visual Studio should re-open, only this time you won't see the window asking if you want to upgrade the project (if you do, select the options for both dropdowns that say something like Leave as Is).
  3. Go to Build > Build Solution or press F7.
    • A bunch of text should appear in the Console and update.
    • The build process will likely take a few minutes, as VC++ is compiling the whole C4D SDK, future builds will likely be much quicker as only modified files will need to be completely rebuilt.
  4. Assuming everything went correctly, you should see:
    • If you encounter errors, read them carefully and Google liberally. That's how I was eventually able to get it all working on my end (adding v140 support was the issue with my setup).

Verify the Plugins Were Compiled

  1. Open Cinema 4D R20
  2. Plugins > Cinema 4D SDK

Congratulations! You've successfully compiled the Cinema 4D SDK Example Plugins!

Hello and thanks for your elaborate post.

I just want to add that - as you said - one should use Visual Studio 2015 for C++ plugin development. When you re-use the Project Tool it might overwrite your manually changed project files.

Also you can start Cinema 4D from within Visual Studio. You can also define the plugin path by settting the g_additionalModulePath command line argument.

You find information on this in the "Development for Microsoft Windows" manual.

best wishes,

You probably want to add that all projects (including frameworks) have to be set to use C++17 language when using 2017 with platform toolset 141, otherwise there will be compiler errors.
So, no need to install the older platform toolset. 🙂

thank you for this 🙂 it really helped me to get things going again

Thank you for the guide. But is there a way to proceed without downloading 5GB? or is there a way to download the 5GB installer so I can reuse it again.

I'm using R21.

Hi @bentraje, I'm not sure of which 5Gb you are talking about, the cinema SDK is only few mb so I guess you are speaking about Visual Studio. If that the case yes you need visual studio with the C++ component to compile.


Thanks. You are right. It didn't exceed 5GB. I guess 5GB is when it is uncompressed.
I was able to build the plug-ins now.