• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Indexer takes wrong locations for C++ headers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Indexer takes wrong locations for C++ headers


  • Subject: Re: Indexer takes wrong locations for C++ headers
  • From: Geoff Leyland <email@hidden>
  • Date: Mon, 22 Mar 2004 12:42:47 +1200

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.


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.


  • Follow-Ups:
    • Re: Indexer takes wrong locations for C++ headers
      • From: Andreas Grosam <email@hidden>
    • Re: Indexer takes wrong locations for C++ headers
      • From: Allan Odgaard <email@hidden>
  • Prev by Date: winCVS server
  • Next by Date: Debugger ignore all breakpoints
  • Previous by thread: Indexer takes wrong locations for C++ headers
  • Next by thread: Re: Indexer takes wrong locations for C++ headers
  • Index(es):
    • Date
    • Thread