0

I have been trying to add MobileSynth to my application for some time now and I am only running into errors.

I have followed the steps here which explain how to add a project into another one.

When I compile, both projects are compiled correctly without errors, but the moment I try import the code into my objective C source code I get a large number of errors.

This is a screenshot of the errors. enter image description here

enter image description here

Im sure there are more errors than these as there seems to be something wrong with the dependencies.

I also approved Xcodes recommendation to convert the project 2 (containing the objective C viewcontrollers with .mm extensions and the .cpp files) from an old 3.something version to the version 4 project type, and made the snapshot. Didnt seem to change anything.

I am not sure how to solve these issues. I would really appreciate any help.

4

2 回答 2

0

您知道使用 C++ 的文件需要 .mm 扩展名。您还需要考虑导入依赖项。由于此标头包含 C++,因此导入它的任何其他文件也需要具有 .mm 扩展名。我几乎可以肯定这就是发生在你身上的事情。

出于这个原因,我通常会尝试将 C++ 隔离到实现文件中。

此外,为了澄清以前的建议:

// Correct
namespace synth { class something; }

// Incorrect
using namespace synth { class something; } 

// Optional
namespace synth { class something; }
using namespace synth;
于 2012-07-13T17:20:12.587 回答
0

使用using namespace而不是namespace.

于 2012-07-13T16:21:09.917 回答