Strange Xcode behavior with multiple references to same file
Strange Xcode behavior with multiple references to same file
- Subject: Strange Xcode behavior with multiple references to same file
- From: "B.J. Buchalter" <email@hidden>
- Date: Sun, 01 Apr 2007 00:15:43 -0400
- Thread-topic: Strange Xcode behavior with multiple references to same file
Hi Folks,
I recently encountered a strange problem with Xcode 2.4.1 and was hoping to
get some feedback from other users or members of the Xcode team as to the
nature of the bug -- I know there is a bug here, I am just not sure what it
is.
Basically, I have a project with a few hundred source files. The files are
in a hierarchy of groups in the Group Tree in the project. As it turns out,
a bunch of my headers were not included in the project, and as a result some
things were not working correctly (like being able to switch to the header
file or to find the definition of a class for the headers that were not
included in the project). So I dragged my headers folder from the finder
into the groups pane. It created a new group with all the headers in it. The
things that were not working correctly start to work. I was happy.
Then I went and compiled my project. It failed at link due to multiply
defined symbols.
After a bunch of hair pulling, I came to realize that there was one .cpp
file in the headers folder I had just added. This file defined one global
variable, and that was the multiply defined symbol. I had already included
that file in the project long ago.
Ok -- so now to the real problem:
1) The file that was included in the project twice is only compiled ONCE,
but it is added to the list of files to line TWICE.
2) If I select the project in the Group Tree, and then type the name of the
file into the seach field in the project window, the File only appears in
the file list above the edit pane ONCE.
3) If I control-click on the file in the file list pane and select "Delete"
from the contextual menu that comes up and delete the reference, the file
remains listed in the file list pane. If I then rebuild, it works as
expected only linking the file once.
To me, it seems like the IDE has a mixed model of multiple references to the
same file. Some parts of the IDE recognize that there are multiple
references, and other parts don't.
(a) I think the bug is that EVERYTHING in the IDE should treat multiple
references to the same physical file as one reference -- perhaps even
enforcing the semantic that there can only be one reference and if you add
the same file again, it simply replaces the original reference.
(b) OTOH, if that is not the case, or cannot be guaranteed, then the IDE
should treat multiple references as distinct (for example in the file list)
so that you can easily find them. Perhaps there is a valid reason to have
the same file referenced twice; I can't think of it, but it could exist.
But the way it works now, having two references to the same file results in
a link error, but the IDE makes it almost impossible to find the duplicate
reference, since it only appears in the Group tree -- which cannot be
sorted, and can have significant hierarchy. The file pane, which is designed
to flatten the hierarchy collapses multiple references into one row in the
table, making it very difficult to detect the problem.
So, my question is -- what's the bug (a) or (b)? Or am I missing something?
Best regards,
B.J. Buchalter
Metric Halo
5 Donovan Drive
Hopewell Junction, NY 12533 USA
tel +1 845 223-6112
fax +1 603 250-2451
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden