#include <vector> no such file or directory

Therefore, I need to use vectors in my project. I changed the .m file to .mm to make it Objective-C ++. But when I try to say:

#include <vector> 

My .h says no file or directory found. If I put this line of code, although in my .mm file, although the error does not appear, but since I need a vector in @interface (which is in my .h), what should I do to make the .h file find the vector file ?

In addition, I tried to change it to compile everything as Objective-C ++, but this does not work, because I get some errors in the Cocos2d library that I use ...

+6
source share
2 answers

Is your .h file included in any OTHER .h or .m files?

If so, you will have to make these (or files, including, etc.), on .mm as well.

+27
source

Without changing the .m to .mm or something like that, if you click on your project, click tagets-> build settings go to level "LLVM GCC 4.2 - Languages" you will see Compile sources as , change this value to Objective- C ++ ;

+6
source

Source: https://habr.com/ru/post/891400/


All Articles