3

I've upgraded from using Xcode 6.2 to 7.3 for a c++ program with external build system recently. Nothing changed on the actual code but 7.3 somehow doesn't syntax highlight certain parts of my code anymore which was correctly colored by 6.2.

Here is an example of the correctly colored code by 6.2:

correct color

And here the same code in Xcode 7.3

no color

I already tried to rebuild the indexes, delete derived data, clean rebuild, and I also waited quite some time since it sometimes just takes some time, nothing worked so far. What is strange, is that i think I saw it working once for a brief amount of time until it disappeared again. Usually cmd+click also takes me to the declaration of a symbol or method, which works fine in 6.2 but in 7.3 I usually all of a sudden get a selection of possible declarations in a dropdown to choose from. Sometimes even a "symbol not found".

Is there maybe a known issue with the code coloring or code sense at all in Xcode 7 and c++?

juanchopanza
  • 223,364
  • 34
  • 402
  • 480
p0fi
  • 1,056
  • 12
  • 28
  • click xcode menu and select the preferences.than after set the font and color. – Jigar Mar 26 '16 at 10:47
  • The colors are all set up correctly. – p0fi Mar 26 '16 at 10:52
  • bro fist compare xcode 6.2 and 7.3 all the property] – Jigar Mar 26 '16 at 10:57
  • Is the appropriate scheme selected as active? If you Build, is that code built? Is the code disabled by an enclosing `#if` or `#ifdef`? – Ken Thomases Mar 26 '16 at 15:06
  • The code is't disabled by any preprocessor flag or anything like that. The exact same code is colored correctly in Xcode 6.2 but isn't in 7.3 or now 8. – p0fi Jun 14 '16 at 17:37
  • I have the same issue with Xcode 7.3.1 marking function names as "Plan text" (according to the Fonts & Colors menu). Any update @p0fi? – Parham Aug 11 '16 at 22:12
  • Are you using an external build system to compile your code @Parham? – p0fi Aug 12 '16 at 11:25
  • Yes @p0fi, been using Make up to this point. it is a C++ program I've been working on in Sublime and terminal only so far. Just imported it into a fresh Cocoa Application project in Xcode and noticed this. I'm new with Xcode as well, so might have missed something – Parham Aug 12 '16 at 12:52
  • I would **highly** recommend you to go full Xcode which I also did meanwhile, making the makefile obsolete on my machine. Here is an excellent article describing how to do this: http://hiltmon.com/blog/2015/08/01/simple-c-plus-plus-from-makefiles-to-xcode-builds/ You get rid of the code sense problems and you harnest the full power of the Xcode developer tools like instruments where you can analyze for possible memory leaks and other neat stuff! – p0fi Aug 12 '16 at 16:42
  • Are you including a header in this source file that is already included in your pre-compiled header file? Don't do that. – Trygve Jan 12 '19 at 00:10
  • did you figure this out? – Cerniuk Jul 14 '19 at 13:59

0 Answers0