7

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?

Jonas Gardner
  • 2,458
  • 5
  • 22
  • 28

1 Answers1

7

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

justin
  • 104,054
  • 14
  • 179
  • 226
  • @SpacyRicochet if you renamed it, try quitting Xcode and cleaning your project. also verify the files are being compiled based on their extension `GCC_INPUT_FILETYPE`. – justin May 29 '13 at 21:40
  • 1
    Thanks for the comment. It was something else though; I forgot to check where the particular c++ file was imported. **ALL** those implementation files need to be renamed as well. Almost like a contagious virus :P – SpacyRicochet May 30 '13 at 11:09
  • @SpacyRicochet well, i find correct filenames easiest to maintain. as a quick fix in the future, you could simply specify objc++ inputs using `GCC_INPUT_FILETYPE`. you're welcome – justin May 30 '13 at 15:57