XCode - #include <map>在 ml.hpp 中:没有这样的文件或目录 [英] XCode - #include <map> in ml.hpp : No such file or directory

查看:58
本文介绍了XCode - #include <map>在 ml.hpp 中:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编译 C++ 代码 (OpenCV),但我要编译到最后.我在这些行上只有一些没有这样的文件或目录"编译错误到 XCode 4 中:

I'm trying to compile a C++ code (OpenCV) and I'm going to the end. I just have a few "No such file or directory" compile error into XCode 4 on those lines :

#include <map>
#include <string>
#include <iostream>

我可以包含什么来让它找到文件"?

What may I include to make it find the "files" ?

我没看到.

我使用了另一个基于 OpenCV 的项目,例如里面有 Objective-C,编译过程成功,文件是一样的,我一个接一个地检查了所有的构建设置行,除了更新到我自己的项目文件夹的搜索路径之外,一切都是一样的.文件夹架构是一样的...

I use another project based on OpenCV with Objective-C inside for example that pass the compile process with success, files are the same, and I checked all the Build settings lines one after the other, and it's all the same, except the search pathes that are updated to go to my own project folders. Folder architecture is the same...

我已阅读此链接 但它似乎不是解决方案,因为我不应该在更改文件的任何地方添加代码,因为我不使用任何代码并且示例项目像这样工作正常.我刚刚包含到我的一个 .m 文件中,与示例项目完全一样.

I've read this link but it doesn't seems to be the solution as I should not have to add code anywhere of change files, since I don't use any of the code and the example project works fine like this. I've just included into one of my .m files, exactly like the example project.

推荐答案

我刚刚加入了我的一个 .m文件,与示例完全一样项目.

I've just included into one of my .m files, exactly like the example project.

如果你想使用C++类,你必须使用Objective-C++.您的源文件(不是您的头文件,请注意 - #include 它们的源文件)必须具有 .mm 扩展名.

If you want to use C++ classes, you must use Objective-C++. Your source files (not your header files, mind - the source files that #include them) must have a .mm extension.

这篇关于XCode - #include &lt;map&gt;在 ml.hpp 中:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆