In an XCode project, all of my source files show up in red in the navigator. Double clicking on them does not open them in the text editor.
The file paths are all correct in the file inspector, though, and the project compiles perfectly well.
It's as if the compiler part of xcode can find the files, but the text editor part can't.
Can anyone suggest how I might fix the project so that I can open the source files in the editor?
Curiously, I've tried deleting and re-adding the them, but this doesn't seem to work. The file names still show up in red.
Any ideas?
Hm. Originally, all the troublesome files had a variable in their path, e.g.
$(MY_LIBRARY_LOCATION)/src/file.cpp.Originally
MY_LIBRARY_LOCATIONwas an absolute path (/Users/me/my_libs'). I first tried changing it to a relative path (../../../my_libs`). This didn't help.Finally, I opened up the XCode project file (
myproj.xcodeproj/project.pbxproject) in a text editor and removed all references to the variable. Instead I hard-coded the absolute paths to all the files (e.g./Users/me/my_libs/src/...). This solved the problem.It's neither elegant nor portable, but, hey, it works.