Search code examples
objective-cxcode4xcode4.2

Lexical or Preprocessor Issue with "#import <map>


I have an XCode 4.2 project that I've been working with all day just fine and all of the sudden, after an XCode crash, my project started to compile with the error:

"file myClass.m: error: Lexical or Preprocessor Issue: 'map' file not found"

where myClass.m uses:

#import <map>
#import <vector>

I've tried a clean build but xcode is still complaining. How can I get it to recognize std:vector and std:map libraries again?


Solution

  • it's because your source is not c++ or objc++. change myClass.m to myClass.mm.