Lexical or Preprocessor Issue with "#import <map>
Asked Answered
S

1

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?

Stratovision answered 9/11, 2011 at 22:40 Comment(0)
P
7

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

Principalities answered 9/11, 2011 at 22:48 Comment(3)
@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.Principalities
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 :POutcaste
@Outcaste 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 welcomePrincipalities

© 2022 - 2024 — McMap. All rights reserved.