So I need to use vectors in my project. I have changed the .m file to .mm to make it Objective-C++. But, when I try saying:
#include <vector>
In my .h it says the file or directory can not be found. If I put that line of code though in my .mm file though the error doesn't appear, but since I need a vector in the @interface
(which is in my .h) what should I do to make the .h file find the vector file?
Also, I have tried changing it to compiling everything as Objective-C++, but that doesn't work because I get some errors in the Cocos2d library I am using...
Is your .h file being included in any OTHER .h or .m files?
If so, you'll have to make those (or files including them, etc) into .mm as well.
Without changing any .m to .mm or anything like that, if you click your project, click tagets->build settings go all the way down to "LLVM GCC 4.2 - Languages" you will see Compile Sources As change that value to Objective-C++;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With