Multiple configuration problem 
Author Message
 Multiple configuration problem

Hi,

I have 2 Release configurations in my project. The only difference
between them is that one file (tools.cpp) would produce different
results depending on whether a macro is defined. (I have the macro set
in one config, and not in the other.)

Since that is the only difference, I decided to have the Intermediate
directory set to the same for both configs to save time and space
during builds. The problem is, when switching between configs,
tools.cpp would not be recompiled if it hasn't been changed. The
linker would use the tools.obj produced by the other config, and
generate the same exe file again.

I think that the solution would be to have tools.cpp produce 2
different output files depending on the config (say, tools1.obj and
tools2.obj), and have the linker use the appropriate one. But I'm not
quite sure how to do this.

If anyone knows how to, or knows of any other solution, please help
me!

Thanks



Fri, 12 Dec 2003 11:20:53 GMT  
 Multiple configuration problem

Quote:
> I think that the solution would be to have tools.cpp produce 2
> different output files depending on the config (say, tools1.obj and
> tools2.obj), and have the linker use the appropriate one. But I'm not
> quite sure how to do this.

Well, I think you're right with that solution. But instead renaming
the output file you can just change the Output directory for
intermediate files for this file.
I mean you set the output intermediate directory for that file the
following:
Release\alt
So, the output file will be with conf#1: relase\tools.obj and with
conf#2: release\alt\tools.obj
The dependencies will be updated accordingly.
Quote:

> Hi,

> I have 2 Release configurations in my project. The only difference
> between them is that one file (tools.cpp) would produce different
> results depending on whether a macro is defined. (I have the macro set
> in one config, and not in the other.)

> Since that is the only difference, I decided to have the Intermediate
> directory set to the same for both configs to save time and space
> during builds. The problem is, when switching between configs,
> tools.cpp would not be recompiled if it hasn't been changed. The
> linker would use the tools.obj produced by the other config, and
> generate the same exe file again.

> I think that the solution would be to have tools.cpp produce 2
> different output files depending on the config (say, tools1.obj and
> tools2.obj), and have the linker use the appropriate one. But I'm not
> quite sure how to do this.

> If anyone knows how to, or knows of any other solution, please help
> me!

> Thanks



Fri, 12 Dec 2003 22:16:09 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Multiple configurations and sub-projects

2. Multiple configurations under the same project ( VC++ 5.0/6.0)

3. Exe/Dll from one project with multiple configurations?

4. Multiple MSDEV configurations

5. Configuration Manager loses configurations

6. Unhandled Exception: System.Configuration.ConfigurationException: Could not create System Configuration.NameValueSectionHandler, System

7. DCOM configuration problems....

8. Problem w/ subproject configuration in ATL

9. Dll Universal Problem Solver (DUPS) configuration info??

10. problem with project dependencies and configurations!!

11. Dll Universal Problem Solver (DUPS) configuration info??

12. problem appending to popup CMenu in Release configuration

 

 
Powered by phpBB® Forum Software