VC++项目,想要在另一个 IDE 中编译,但缺少一些东西

发布于 2024-12-07 03:58:55 字数 1579 浏览 0 评论 0原文

我对 C++ 相当陌生。
我想为名为 Cinema 4D 的应用程序编写插件。
C4D 的制造商 Maxon 提供了用于执行此操作的 API。头文件位于一个特殊的文件夹中。

“cinema4dskd”是一个包含示例插件的 Visual Studio 项目。在这个项目中还有另一个名为 _api 的子项目。

在此处输入图像描述

弹出窗口是“项目依赖项”对话框。

_api 子项目似乎是指向我的本地驱动器上存在的文件的链接,但它不在cinema4dsdk.vcproj 内。
_api 项目中的所有文件都位于 Cinema 4D 安装路径中也称为 _api 的文件夹中。
它充满了头文件和 .cpp 文件。
这基本上就是我编译 Cinema 4D 插件所需的内容,包括源代码中的“c4d.h”。
但这就是问题开始的地方。

我正在尝试在 Code::Blocks 中编译一个插件,我已添加了“c4d.h”等的所有路径。但是每个编译器(gcc,甚至 msvc!)都告诉我数千个关于以下内容的警告:

C :\Programs\MAXON\Cinema 4D R12\resource\_api\ge_prepass.h |2668|警告:多字符字符常量|

最后出现一个错误未声明 C4DGLuint。为什么它可以在 VC++ 中运行,但不能在任何其他编译器中运行?我肯定错过了什么,但我真的不知道是什么。

我认为我不被允许共享此项目,因为 _api 归 Maxon GmbH 所有,但如果您确实需要它,我恳求您下载 Cinema 4D 演示版,其中 cinema4dskd 项目包含在内。

如果您需要任何进一步的信息,请告诉我,我希望您知道可能缺少什么。为什么 VC++ 可以正确编译插件,但我不能使用命令行或任何其他 IDE?

非常感谢。
Niklas

更新:

多字符常量错误示例:

C:\Users\niklas\Documents\CodeBlocks\Cinema4D\_api\src\gui.h|690|警告:多字符字符常量|
C:\Users\niklas\Documents\CodeBlocks\Cinema4D\_api\src\gui.h|693|警告:多字符字符常量|

690: BFM_SETVIEWPORTORIGIN  = 'cORG',
691:    BFM_SETVIEWPORTORIGIN_X=1,
692:    BFM_SETVIEWPORTORIGIN_Y=2,
693: BFM_SETVIEWPORTSIZE    = 'cSIZ',

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',

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

泅人 2024-12-14 03:58:55
'cORG'

是所谓的多字符文字。它的值不适合 char 变量,您需要一个“int”来保存它,根据这篇文章

C++ 多字符文字

这是编译器特定的解释方式。似乎您测试过的其他编译器不支持此类文字。

'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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文