Article View: comp.std.c++
Article #2480Re: Header file inclusion and multiple directories
From: John Max Skaller
Date: Wed, 08 Nov 1995 17:24
Date: Wed, 08 Nov 1995 17:24
42 lines
2004 bytes
2004 bytes
matt@cyclops5.berkeley.edu (Matt Austern) wrote:
>
>Consider a project that spans several directories.
>So my challenge: can anyone think of an acceptable replacement for
>"The named source file is searched for in an implementation-defined
>manner" that would provide a bit more of a guarantee of reasonable
>behavior?
A second answer to this question:
// filelist.h
#define MYFILE "myfile.h"
#define YOURFILE "../yourfile.h"
#define HISFILE "/root/lib/include/system/project/hisfile.hpp"
// main.cc
#include "filelist.h" // current directory!
#include MYFILE // wherever they live
#include YOURFILE
#include HISFILE
#include HERFILE
main() { ..}
This minimises the changes required to the
file "filelist.h", and imposes only the
requirement that IT be found by
#include "filelist.h"
Its contents may need to be edited when moving things,
which is a pain, but at least it is a localised pain.
--
John Max Skaller voice: 61-2-566-2189
81 Glebe Point Rd fax: 61-2-660-0850
GLEBE NSW 2037 email: maxtal@suphys.physics.oz.au
AUSTRALIA email: skaller@maxtal.com.au
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<47qlq7$f37@oznet03.ozemail.com.au>Path:
arc1-ca.pugleaf.net!in2.uu.net!bounce-backReferences:
<MATT.95Nov2152444@cyclops5.berkeley.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back Date: 08 Nov 95 17:24:16 GMT Approved: fjh@cs.mu.oz.au From: John Max Skaller <maxtal@suphys.physics.su.oz.au> Newsgroups: comp.std.c++ Subject: Re: Header file inclusion and multiple directories X-Original-Date: 8 Nov 1995 16:27:51 GMT Organization: MAXTAL Message-ID: <47qlq7$f37@oznet03.ozemail.com.au> References: <MATT.95Nov2152444@cyclops5.berkeley.edu> X-Mailer: Mozilla 1.2N (Windows; I; 16bit) X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMKDnzOEDnX0m9pzZAQGtXwGAhESdWK42WX62t9GA2zec2hUSPtgtXr5e UvMfzsN7I7I2gjJ43ltWyD5ITEgkWM5g =yEN0