1

I am fairly new to C++.
I want to write plugins for an application called Cinema 4D.
Maxon, the maker of C4D, provides an API for doing this. The header-files are located in a special folder.

The "cinema4dskd" is a Visual Studio project containing sample plugins. Within this project there is another subproject called _api .

enter image description here

The popupwindow is the "Project dependencies" dialog.

The _api sub project seems to be a link to a file that is present on my localdrive but it is not within the cinema4dsdk.vcproj.
All files within the _api project are located in a folder in the Cinema 4D installation path also called _api.
It is full of header and .cpp files.
This is basically what I need to compile plugins for Cinema 4D, including "c4d.h" in my source code.
But this is where the problems start.

I'm trying to compile a plugin within Code::Blocks, I have added all paths to "c4d.h", etc. But every compiler (gcc, and even msvc !) tell me thousands of warnings about:

C:\Programs\MAXON\Cinema 4D R12\resource\_api\ge_prepass.h |2668|warning: multi-character character constant|

And finally an error that C4DGLuint isn't declared. Why does it work in VC++ but not with any other compiler ? I must have missed something, but I really don't know what.

I don't think I am allowed to share this project, as the _api is owned by Maxon GmbH, but if you really need it I beg you to download the Cinema 4D Demo version where the cinema4dskd project is included.

Tell me if you need any further information, I hope you have an idea what may be missing. Why the heck can VC++ compile the Plugins right, but I can't using the command-line or any other IDE ?

Thank you very much.
Niklas

Updates:

Example of multicharacter constant error:

C:\Users\niklas\Documents\CodeBlocks\Cinema4D\_api\src\gui.h|690|warning: multi-character character constant|
C:\Users\niklas\Documents\CodeBlocks\Cinema4D\_api\src\gui.h|693|warning: multi-character character constant|

690: BFM_SETVIEWPORTORIGIN  = 'cORG',
691:    BFM_SETVIEWPORTORIGIN_X=1,
692:    BFM_SETVIEWPORTORIGIN_Y=2,
693: BFM_SETVIEWPORTSIZE    = 'cSIZ',
Niklas R
  • 16,299
  • 28
  • 108
  • 203
  • 1
    Where is C4DGLuint declared? Are you including that header? As for the warnings, can you paste the exact line? – Luchian Grigore Sep 29 '11 at 19:25
  • Ah, good one, I thought all headers are included in `c4d.h`, but `c4d_gl.h` isn't. If I add it to `operatingssystem.h`(where the error occures) it works, but another comes up (Also, I shouldn't modify theese files I think, they work in VC++ as well). `C4DOS is not declared in this scope.`. I see, C4DOS is externed in *operatingsystem.h*: `extern OperatingSystem C4DOS;`, but in the file where the error occures, *operatingsystem.h* is included. – Niklas R Sep 29 '11 at 19:38
  • Btw, I have copied `_api` to Code::Blocks now and try to build it (it is setup as a .lib in VC++, however, but I couldn't see where it is linkd into the cinema4dskd ?) so I can just test it when I may need to modify the files ^^ Man very hard to explain, especially as I'm so new to compilation stuff. – Niklas R Sep 29 '11 at 19:40
  • "As for the warnings", I'll do, see update. – Niklas R Sep 29 '11 at 19:42
  • For above, `OperatingSystem` is a struct declared some lines above, it has pointers to other parts of the C4D api. – Niklas R Sep 29 '11 at 20:02

1 Answers1

1
'cORG'

is a so-called multi character literal. Its value does not fit into a char variable, you will need an 'int' to hold it, and according to this post

C++ multicharacter literal

it is compiler-specific how this thing is interpreted. Seems the other compiler you have tested does not support those kind of literals.

Community
  • 1
  • 1
Doc Brown
  • 19,739
  • 7
  • 52
  • 88
  • Using Msvc with CodeBlocks gives the same warnings, but not in visual studio. But maybe they are suppressed there ? – Niklas R Sep 30 '11 at 05:04