简体   繁体   中英

VS2010 Debug and Release Clean and Rebuild

I have one project (in c/c++ ) which consist of two solutions. First one is "build_model", another is "fit_model". I set up properties to put all binaries in the same directory as "fit_model" will invoke during it's execution "build_model".

So, I first compile "build_model" and it goes well. All files are put into .../bin\\ Then I compile "fit_model" and it is OK as well. All files are put into .../bin\\ Everything works fine. Even if do "Clean" and "Rebuild" for "fit_model" only it's binaries are deleted are re-created. That is for Release build. Clean & Re-build of "build_model" also cleans only it's own binaries (as it should be).

But when I switch to Debug mode, as soon as I do Clean for "fit_model" it deletes all of the binaries in .../bin\\ folder, including it's own and binaries from "build_model". This is NOT what I want.

So, this is not happening in Release, but only for Debug clean & rebuild.

Which settings should I change?

(VS2010, Windows7)

EDIT: The problem is that even with different directories it does the same. Also, adding "d" and "r" for debug and release to $(ProjectDir) won't do the trick.

I don't know how it finds the path at all? There is bin directory with two subdirectories: fit and build

So how it comes that Clean for Solution fit_model "cleans" build directory besides his own fit as well?

If you don't want to do the sensible thing and use different directories, like Hans suggested , then you'll need to change the name of the output files.

In your project's properties window (Configuration Properties → General), there is a property called "Target Name". It defaults to the name of your project. You need to change it to something different in your debug and release builds.

You can do something simple like adding a d to the end of the name for the debug version. For example, $(ProjectName)d will automatically pick up the project's name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM