#include<vector> no such file or directory

Viewed 17164

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

3 Answers

I was unable to upgrade to Xcode 11.1, so I trashed Xcode 11.0, then downloaded Xcode 11.1. Xcode 11.1 worked until I rebooted where I got the above message on the default "hello world" command line C++ program.

My solution was to: quit Xcode, empty the trash, launch Xcode

Related