Xcode gets the wrong path when adding files

Discussion in 'Mac Programming' started by printz, Nov 14, 2013.

  1. printz macrumors regular

    Dec 23, 2012
    In my instance I'm using Xcode 5 and programming a command-line tool. I'm not sure if it happens with Xcode 4 and .app target. Anyway, I have this directory structure:

    (srcroot)/src/*.c, src/*.h

    If I use Xcode to create a new C or H file, the save dialog will always show me the xcode/appname/ path, so I have to move up until I get to src, and then I save the new file there. But it will appear red on the project navigator, and "get info" will show the wrong absolute path (usually a missing path component before src/whatever.c). If I change the path from "get info" to the correct one, it will work.

    If I alternatively create the file in src/ externally and add it to Xcode, its path will be correctly detected on the navigator, but when I try to compile, it will say something like "(srcroot)/xcode/appname/src/whatever.c not found!", despite src/ being on (srcroot), not xcode/appname.

    I'm working on a Git repository, that was cloned with another application (SourceTree), not Xcode.
  2. hkspirt macrumors newbie

    Mar 6, 2014
    How did you resolve this problem

    I have the same problem:confused:

Share This Page