From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5500 invoked by alias); 4 Aug 2005 06:48:53 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 5226 invoked by uid 22791); 4 Aug 2005 06:48:45 -0000 Received: from mailgw4.technion.ac.il (HELO mailgw4.technion.ac.il) (132.68.238.37) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 04 Aug 2005 06:48:45 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mailgw4.technion.ac.il (Postfix) with ESMTP id 85D83F79F3 for ; Thu, 4 Aug 2005 09:35:19 +0300 (IDT) Received: from mailgw4.technion.ac.il ([127.0.0.1]) by localhost (mailgw4.technion.ac.il [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 11472-01-86 for ; Thu, 4 Aug 2005 09:35:19 +0300 (IDT) Received: from techmail.technion.ac.il (techmail.technion.ac.il [132.68.1.33]) by mailgw4.technion.ac.il (Postfix) with ESMTP id 71D4AF79E5 for ; Thu, 4 Aug 2005 09:35:19 +0300 (IDT) Received: by techmail.technion.ac.il (Postfix, from userid 48) id 682044C04A; Thu, 4 Aug 2005 09:48:42 +0300 (IDT) Received: from bzq-25-124-149.cust.bezeqint.net (bzq-25-124-149.cust.bezeqint.net [212.25.124.149]) by webmail.technion.ac.il (IMP) with HTTP for ; Thu, 4 Aug 2005 09:48:42 +0300 Message-ID: <1123138122.42f1ba4a522b7@webmail.technion.ac.il> Date: Thu, 04 Aug 2005 06:48:00 -0000 From: Dima Sorkin To: gcc-help@gcc.gnu.org Subject: Re: order of headers lookup References: <1122984523.42ef624b0ce82@webmail.technion.ac.il> <4a618d0805080205273aeb3054@mail.gmail.com> In-Reply-To: <4a618d0805080205273aeb3054@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=Windows-1255 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.4 X-SW-Source: 2005-08/txt/msg00067.txt.bz2 Quoting Arturas Moskvinas : > > directory structure of a tiny project: > > /main.cpp (#include "foo.hpp" ) > > /d1/bar.hpp > > /d2/foo.hpp (#include "bar.hpp") > > /d2/bar.hpp > > > > then compiling > > > g++ -I d1 -I d2 main.cpp -o main > > will include /d2/bar.hpp instead of /d1/bar.hpp as I expected > > ( I expected so because "d1/" is listed first in "-I" options). > > It is from C preprocessor manual: > #include "file" > This variant is used for header files of your own program. It > searches for a file named file first in the directory containing the > current file, then in the same directories used for . > > So, i think you should use #include to get your wanted behavior... Yes, it works. Thank you. Dima.