Issue: CommandData Plugin Compilation Errors in Cinema 4D 2025.1.0 SDK
-
Hi.
I'm new to this field, so don't judge me too harshly.
I am trying to create a simple CommandData plugin for Cinema 4D 2025.1.3 following the SDK documentation.
However, I am encountering multiple compilation errors, despite the fact that all example projects from the SDK compile and work correctly.Errors:
Here are some of the main errors I'm facing:
C2504: 'CommandData': base class undefined
C2086: 'int Bool': redefinition
C3646: 'Execute': unknown override specifier
C2065: 'GeDialog': undeclared identifier
C2065: 'BaseDocument': undeclared identifier
C2096: 'Bool': A data member cannot be initialized with a parenthesized initializerWhat I Have Checked:
All SDK example projects compile successfully.
My project is in the same solution as the example projects.
I'm using Visual Studio 2019 with /std:c++17, as recommended in the SDK.
The SDK headers and libraries are correctly linked.
CommandData should be defined in c4d_commanddata.h, but the compiler doesn't recognize it.Question:
Has something changed in how CommandData plugins should be structured in Cinema 4D 2025?
Do I need to include additional headers or modify my implementation?
Any guidance or better tutorial would be greatly appreciated.
TIAWindows 11/64, VS 2019, SDK 2025_1_0, Cinema 4D 20251.3
-
Hi @skibinvitaliy
There's a few things to watch out for here. First, you will need to include at the very least the file c4d.h from the framework, if this is missing that might account for the undeclared identifiers.Assuming you're doing that, you must either use the cinema namespace or specifically qualify function declarations etc. If you don't, the compiler won't recognise the C4D functions and objects as valid. The manual explains how to do this, it's not difficult - just an extra step to take which I keep forgetting because it's new to R2025.
The error 'int Bool' redefinition is because what it looks like you're doing there is declaring a variable named 'Bool' to be of type 'int'. But 'Bool' cannot be a variable, it's a variable type (actually a typedef defined by the SDK) so the compiler thinks you are redefining it, which isn't allowed.
These are all just guesses though without seeing any code, but the first thing to look at is the namespace. Catches me out every time.
Steve
-
Hey @skibinvitaliy,
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: How to Ask Questions.
About your First Question
No one is judging you here, problems are part of the game and what we are here for to help with
. But please familiarize yourself with our forum rules, such question should be accompanied by example code and the version you are migrating from, as we otherwise mostly have to guess what is going wrong.
I am assuming you are migrating from a pre-2025 SDK, that is at least what your errors imply. With 2025 we introduced our
cinema
namespace. Please follow our Migrating Plugins to the 2025.0 API guide. You are likely just missing a couple ofusing namespace cinema;
at the top of your files.Cheers,
Ferdinand