There are three solutions to active Objective C++ compilations

  1. By Objective C++ default file extention: .mm — This a most security way to active Objective C++ complilation. Xcode will set automatically the corresponding runtime target for the project at build time.
  2. Set Xcode project build settings(under GCC 4.2 Language) — Either add -x objectiveC++ to « Other C Flags » or set « Compile Sources As » to « ObjectiveC++ »
  3. Select the file from Xcode’s Groups & Files list, select File->Get Info and changge the file type to « Sourcecode.cpp.objcpp ».