问候。
我正在研究 mpeg layer-III 编码为即将到来的项目工作的方式。我下载了 Shine 编码器,据说它是最简单的。http://www.mp3-tech.org/programmer/sources/shine.zip是链接。
我在独立项目中成功编译了它们,但我需要在 QT 项目中使用它们。
我在 QT 中创建了新的空白控制台项目,并将之前为我成功编译的所有文件添加为现有文件(来自 Shine.zip 的文件)。
这是我的 main.cpp:
#include <QtCore/QCoreApplication>
#include "main.h"
int main(int argc, char *argv[])
{
// QCoreApplication a(argc, argv);
// return a.exec();
mainc(argc,argv);
}
这是 main.h:
#ifndef MAIN_H
#define MAIN_H
#include "main.c"
#endif // MAIN_H
其他一切都没有改变(我的意思是,没有这两个文件它成功编译并工作)
我现在在这部分遇到错误
#ifndef bool
typedef unsigned char bool; <--- "redeclaration of C++ built-in type 'bool'"
#endif
之前这里没有错误。据我了解,一个 cpp 文件的存在使所有代码都编译为 c++,而闪耀代码是 c,而不是 c++……这是否意味着我不能在使用 QT 类 QCoreApplication 的项目中使用 c 代码?