xcode 找不到 Cocos2D kazmath/kazmath.h 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9882175/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 23:47:24  来源:igfitidea点击:

Cocos2D kazmath/kazmath.h file not found

iosxcodecocos2d-iphonedirectory

提问by SimplyKiwi

In my app, I am upgrading from Cocos2D version 1.10->2.0-rc0a.

在我的应用程序中,我从 Cocos2D 版本 1.10->2.0-rc0a 升级。

So I did everything the right way as far as I know, the problem I think just has to do with the user header search path.

因此,据我所知,我以正确的方式做了所有事情,我认为这个问题与用户标题搜索路径有关。

So my Cocos2D files are withina folder withina folder withina folder withina folder, which is on my Desktop. So the actual cocos2D files are 4 folders within until it gets to the desktop.

所以我的 Cocos2D 文件位于文件夹文件夹的文件夹内,该文件夹位于我的桌面上。所以实际的 cocos2D 文件在进入桌面之前有 4 个文件夹。

And my user header search path looks like this:

我的用户标题搜索路径如下所示:

"/Users/myname19/Desktop/NewMyAppBeta/MyApp3/MyApp3"

So the full error is: Lexical or Preprocessor Issue, 'kazmath/kazmath.h' file not found in CCNode.h. There are actually 4of these issues but they are identical.

所以完整的错误是:词法或预处理器问题,在 CCNode.h 中找不到“kazmath/kazmath.h”文件。这些问题实际上有4 个,但它们是相同的。

Does anyone know how to fix this issue?

有谁知道如何解决这个问题?

Thanks!

谢谢!

采纳答案by LearnCocos2D

Did you try turning it off and on again?

您是否尝试将其关闭并重新打开?

Meaning: check if the kazmath.h file is actually there where it's supposed to be. If not, copy it respectively the entire kazmath folder. It's notunder the cocos2d folder but in a separate "external" folder so chances are you might have missed to copy it into your project.

意思是:检查 kazmath.h 文件是否真的在它应该在的地方。如果没有,请分别将其复制到整个 kazmath 文件夹。它不在cocos2d 文件夹下,而是在一个单独的“外部”文件夹中,因此您可能错过了将其复制到项目中的机会。

回答by Darko Pavlovic

Little workaround that worked for me.

对我有用的小解决方法。

I was using Xcode 4.5.1.

我使用的是 Xcode 4.5.1。

I included cocos2d library in my project, and after that I have included kazmath library from external folder.

我在我的项目中包含了 cocos2d 库,之后我从外部文件夹中包含了 kazmath 库。

I replaced all occurrences of "kazmath/kazmath.h" with "kazmath.h" and all "kazmath/GL/something.h" with "something.h". After that, everything has been built ok.

我用“kazmath.h”替换了所有出现的“kazmath/kazmath.h”,用“something.h”替换了所有“kazmath/GL/something.h”。在那之后,一切都已经建立好了。

回答by Kursat Turkay

Be sure to include the double quotes. something like "${SRCROOT}/TestProjet1/libs/kazmath/include" (also with recursive option selected)

确保包含双引号。类似于“${SRCROOT}/TestProjet1/libs/kazmath/include”(也选择了递归选项)

回答by Mika

I had the same problem.

我有同样的问题。

All you need to do is to add the path to the kazmath headers to Build Settings > Header search paths

您需要做的就是将 kazmath 标头的路径添加到“ 构建设置”>“标头搜索路径”

for example lib/kazmath/include

例如 lib/kazmath/include

回答by Mann

Go to Build Settings then Search for Header Search Paths. There add relative path of kazmath folder.

转到构建设置,然后搜索标题搜索路径。添加kazmath文件夹的相对路径。

"./lib/kazmath/include"   //Where . is project directory.