未知类型名称“类”;您指的是“Class”吗?奥里奥触摸

发布于 2025-01-08 06:26:47 字数 563 浏览 3 评论 0原文

我正在尝试将代码从 AurioTouch 项目移动到我的项目。 但我有很多错误:

Unknown type name 'class'; did you mean 'Class'?

例如,在文件 FFTBufferManager.h 中:

#include <AudioToolbox/AudioToolbox.h>
#include <libkern/OSAtomic.h>

#include "SpectrumAnalysis.h"

class FFTBufferManager
{
public:
    FFTBufferManager(UInt32 inNumberFrames);
    ~FFTBufferManager();

我尝试将编译器更改为 LLVM GCC 4.2,但它给出了很多其他错误:

Expected '=', ',', ';', 'asm' or '__attribute__' before 'FFTBufferManager'

我做错了什么?

I'm trying to move code from the AurioTouch project to my project.
But I have many errors:

Unknown type name 'class'; did you mean 'Class'?

For example, in file FFTBufferManager.h:

#include <AudioToolbox/AudioToolbox.h>
#include <libkern/OSAtomic.h>

#include "SpectrumAnalysis.h"

class FFTBufferManager
{
public:
    FFTBufferManager(UInt32 inNumberFrames);
    ~FFTBufferManager();

I tried to change the compiler to LLVM GCC 4.2, but it gives a lot of other errors:

Expected '=', ',', ';', 'asm' or '__attribute__' before 'FFTBufferManager'

What am I doing wrong?

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

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

发布评论

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

评论(1

别挽留 2025-01-15 06:26:47

要混合 C++ 和 Objective-C,您需要使用 .mm 扩展名。但是,如果您的类只是 C++(并且仅包含 C/C++ 标头),那么您可以使用普通的 .cpp 扩展名。

.mm
具有此扩展名的源文件除了 Objective-C 和 C 代码之外还可以包含 C++ 代码。这个扩展应该
仅当您实际引用 C++ 类或功能时才使用
你的 Objective-C 代码。

To mix C++ and Objective-C you need to use the .mm extension. If, however, your class is only C++ (and only includes C/C++ headers) then you can use the normal .cpp extension.

.mm
A source file with this extension can contain C++ code in addition to Objective-C and C code. This extension should
be used only if you actually refer to C++ classes or features from
your Objective-C code.

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