Re: Indexer takes wrong locations for C++ headers
Re: Indexer takes wrong locations for C++ headers
- Subject: Re: Indexer takes wrong locations for C++ headers
- From: Andreas Grosam <email@hidden>
- Date: Mon, 22 Mar 2004 14:48:55 +0100
On 22.03.2004, at 01:42, Geoff Leyland wrote:
Hi,
On 22/03/2004, at 2:49 AM, Andreas Grosam wrote:
Hi All,
I posted this issue a couple of weeks ago, without any reply --
seems, there is nobody *attempting* to compile C++ projects ...
I've found a header bug that might be related - the *compiler* ends up
including the wrong header files. I think it has something to do with
the way the .hmap file is used, but I haven't investigated much.
There are already some mails in this list related to this problem.
Search for USE_HEADERMAP.
You can disbale using headermaps by setting the property USE_HEADERMAP
to your target's Build Settings, and set its value to NO. But, you may
then encounter other problems :-(
Probably a look into the preprocessor sources would reveal the bug.
Well, there's still the indexer problem searching at wrong locations
for the C++ headers ...
Regards
Andreas
Suppose I have a project and some files split over two folders
p1
p1.h
build
p1.xcode
src
main.cpp
p2
p2.h
p2.cpp
assert.h
p1/src/main.cpp contains:
#include <cassert>
#include "p1/p1.h"
#include "p2/p2.h"
int main (int argc, char * const argv[])
{
assert(true);
p2::say_hello();
return 0;
}
p1/p1.h is empty (it's just there so you get an idea how the folders
are set out.
p2/p2.h declares say_hello, and p2/p2.cpp defines it.
#include <iostream>
#include "p2/p2.h"
void p2::say_hello(void)
{
std::cout << "Hello world\n" << std::endl;
}
and p2/assert.h is a header with an unfortunate name that should never
be used, and contains "void this_should_not_get_declared(void);"
p1/build/p1.xcode needs an extra include path "../../" which gets it
to the directory containing p1 and p2 so that #include "p2/p2.h"
works, but it *does not* have an include path to "../../p2/"
When you compile the project, the system <cassert> just includes
<assert.h> and XCode gets the wrong file, and includes "p2/assert.h"
instead of <assert.h>. It should not be searching for *user* includes
in p2, let alone system includes.
cheers,
Geoff
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.
Andreas Grosam
RSD Technik GmbH
D-79588 Efringen-Kirchen
Walter Wetzel Str. 2
Phone +49 7628 802 0
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.