Xcode 4.2 unexpectedly knows nothing about STL

Yesterday, an old project mixing Objective-C and C ++ was compiled with xCode 4.2. Yes, the corresponding files have a .mm suffix. Today I tried to create a new project using most of the first project as a template, but it will not compile. I get errors like:

Lexical or Preprocessor Issue 'list' file not found 

in response to:

  #include <list> 

and this error:

  Semantic Issue Unknown type name 'class' 

I went back to my old project, which yesterday collected a fine for checking sanity and boom, about the same:

  Semantic Issue Use of undeclared identifier 'std' 

Did xCode suddenly forget how to find the whole standard type library ?! Running gcc from the command line still works fine. One note, all errors come from .h files. It does not matter. To date, xCode has always done the right thing with .h files when they were included from .mm or .cpp. Why does it suddenly stop? I swear I haven’t changed anything!

Thanks in advance...

+4
source share
1 answer

I had this problem too ... I had to go in and change the project settings to compile as Objective-C ++, and not "Default compiler for file type" ... I think this will also be cured if you name the files .cpp.mm. But if you are like me, the code is generic and you cannot just change the file names ...

+4
source

Source: https://habr.com/ru/post/1382433/


All Articles