XCode - #include <map> in ml.hpp : No such file or directory

佐手、 提交于 2019-12-18 09:17:44

问题


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" ?

I don't see.

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...

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.


回答1:


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

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.



来源:https://stackoverflow.com/questions/5574015/xcode-include-map-in-ml-hpp-no-such-file-or-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!