Documentation Archive Developer
Search

ADC Home > Reference Library > Technical Q&As > Tools > Xcode >

Spaces in project names: solving "Missing file or directory" errors in Project Builder


Q: I am getting "Missing file or directory" errors for my project prefix header in Project Builder. How can I get rid of these?

A: Prefix headers are headers included automatically at the top of all source files by Project Builder, without you having to explicitly include them in your source code. Project Builder 2.1 (part of the December 2002 Developer Tools) automatically creates a prefix header for you when you create a new project. The prefix header's name comes from the name of the project, so if you put a space in the name of your project, you will get a space in the name of your prefix header. However, Project Builder 2.1 has a bug (which is fixed in Xcode) where it doesn't properly quote the prefix header's name when compiling, leading to errors due to the space in the filename. Errors will look like Listing 1.

The solution is as follows. In the Targets tab bring up the Target Editor, go to "GCC Compiler Settings," and put quotes around the prefix header name in the "Prefix Header" text field, to ensure that spaces do not cause errors.


[Sep 15, 2003]



Listing 1. The error message if the project name was 'test project'


Missing file or directory: test
Missing file or directory: project_Prefix.h