Need to make compiler search directories in specific order 
Author Message
 Need to make compiler search directories in specific order

I'm having a problem trying to make the compiler search directories in the
order that I want it to.  It arises from my attempts to have 2 levels of
include directories -- a source-controlled one and a local, working one.

In our project, we have number of output files (.TLB, .H,  .LIB, etc) which
other projects depend upon.
Since these are output files and need to be built frequently, we add
post-build steps to each project which copy their output files to a common
directory which we identify with environment variable "CMN_1".

All projects can then add $(CMN_1) to their additional include directories
to get the output automatically.  Then can #include the .H files and #import
the .TLB files with no problems.

This was great except for the fact that higher level projects which do a lot
of #imports, cannot even be built until you first build those other projects
lower down on the food chain.  This became an annoyance so we decided that
we would add all of these files to source control (Visual SourceSafe 5).

We figured we can just add another environment variable ("CMN_2") to point
ot this configured set of .output files.  Now each project can have TWO
additional include directories.  $(CMN_1) and $(CMN_2).  In other words,
even if you have not built Project Y on your machine, you can be assured
that if you do a Get Latest Version (SourceSafe) of the configured project
that is stored in the CMN_2 directory, then Project Y's .TLB file will be in
CMN_2 so you'll at least be able to build.  It might not be the latest and
greated Y.TLB but it will get you goiing.

And here's where we encounter the problem:  It's very important that the
compiler search CMN_1 FIRST as the developer may have changed and built a
lower-level project, superseding the configured output files.  But the
killer here is that the compiler doesn't seem to care what order I specify
these directories in

    Project >> Settings >> C++ >> Preprocessor >> Additional Include
Directories

It always defaults to CMN_2 for the .TLB

I've tried

    $(CMN_1), $(CMN_2)

and I've tried

    $(CMN_2), $(CMN_1)

I"m sure the environment variables are set up correctly.  I'm sure that the
old version of Y.TLB is in CMN_2 and the new version is in CMN_1.  Still
every time time I build, my #import statements go to CMN_2.
I am also sure that I am not pointing to either of these directories in

   Tools >> Options >> Directories

so that's not the culprit.

So, to make an overly long story short, can anyone tell me how to ensure the
order in which directories are searched?

Thanks,

Joe O'



Sat, 16 Sep 2000 03:00:00 GMT  
 Need to make compiler search directories in specific order

Joe, I think you've been around enough to know to do this already, but...

Look in the project file (as text) and see if your path to the CMN_2 got
baked in there somehow.
I don't know what the fix will be, but at least seeing what's wrong may give
you some ideas.  If you're really lucky, a hand-edit of the project file may
fix it for good.

When I've had these kinds of issues I've usually added a first pass to the
big build, which just created LIBs, TLBs, etc.  It required a fair amount of
maintenance (a hand-built makefile) but didn't suffer from tools doing
brain-dead things to you.  It's a fallback if you can't get things to work
out.

--

(remove the xxx from reply address)

Quote:

>I'm having a problem trying to make the compiler search directories in the
>order that I want it to.  It arises from my attempts to have 2 levels of
>include directories -- a source-controlled one and a local, working one.

>In our project, we have number of output files (.TLB, .H,  .LIB, etc) which
>other projects depend upon.
>Since these are output files and need to be built frequently, we add
>post-build steps to each project which copy their output files to a common
>directory which we identify with environment variable "CMN_1".



Sun, 17 Sep 2000 03:00:00 GMT  
 Need to make compiler search directories in specific order

Ed,

Thanks for replying.  I did check the DSP's and hand-edited them just to be
sure.  Still, no dice.
I'll bet there is a simple explanation, but unfortunately we don't have time
to figure it out.  We have too many developers and too many projects to rock
the boat at this point, I think.  And I have no time for that kind of
maintenance, I'm afraid.

For now, we're going to make CMN_1 and CMN_2 point to the exact same
configured directory.  This means that once you have done a build and copied
writeable versions of those output files on top of the read-only versions
that VSS gives you, you'll need to do some manual file moves to check in the
new versions.  Still, it's not that bad.

Thanks again

Joe O'

Quote:

>Joe, I think you've been around enough to know to do this already, but...

>Look in the project file (as text) and see if your path to the CMN_2 got
>baked in there somehow.
>I don't know what the fix will be, but at least seeing what's wrong may
give
>you some ideas.  If you're really lucky, a hand-edit of the project file
may
>fix it for good.

>When I've had these kinds of issues I've usually added a first pass to the
>big build, which just created LIBs, TLBs, etc.  It required a fair amount
of
>maintenance (a hand-built makefile) but didn't suffer from tools doing
>brain-dead things to you.  It's a fallback if you can't get things to work
>out.

>--

>(remove the xxx from reply address)


>>I'm having a problem trying to make the compiler search directories in the
>>order that I want it to.  It arises from my attempts to have 2 levels of
>>include directories -- a source-controlled one and a local, working one.



Sun, 17 Sep 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Need to make compiler search directories in specific order

2. need help on compiler-specific defines

3. "directory searching" make utility needed

4. Need C source for DIR *.TXT/S type application (recursive directory searches)

5. Directory search function needed

6. Searching sub-directories of current directory

7. Making the mouse button events non-position specific?

8. search specific pattern in a string

9. Newsgroup-specific question: searching for messages

10. sorting two-dimensional array whith search-criteria: specific column

11. Searching specific row in the dataGrid and dataSet

12. All User/Specific User directories

 

 
Powered by phpBB® Forum Software