开发者

VC++ project never up-to-date

开发者 https://www.devze.com 2022-12-17 15:32 出处:网络
I\'m using Visual Studio 2008. I have a solution with two projects.One builds a DLL, which is my \"production code\".The other builds a console app exe, which is my unit test suite.

I'm using Visual Studio 2008.

I have a solution with two projects. One builds a DLL, which is my "production code". The other builds a console app exe, which is my unit test suite.

For my unit test project, I have listed as linker inputs the names of the source modules from the DLL. I.e., I have a DLLMain.cpp in the DLL project开发者_JS百科, and a linker input "DLLMain" in the exe project. This allows the exe to link with the obj files produced by the DLL project, preventing recompilation of those modules just for the unit tests. (Saves a lot of build time.)

THE PROBLEM IS that because the exe is produced later than the obj's, and by a different project, its timestamp is always newer than the obj's. So when you try to run or debug, it ALWAYS says the exe project is out of date and needs to be rebuilt.

Is there some way I can configure the exe project to ignore the timestamps? Or is there some other, perhaps more general, solution I'm not seeing here?


Seems like you are creating foo.obj in the DLL's project, linking foo.obj in the DLL project to produce the DLL, and then linking foo.obj to your EXE project without first recompiling it.

I have never done this before, but first thing I would check is to make sure the Intermediate Directory settings are the same for both the EXE project and the DLL project.


Go to the project that is not needed for unit testing
Right click on it and press Properties
Click on Configuration manager
Add a new configuration using the first drop down list
Click ok
Select that configuration in the window that is now focused
then in configuration properties set "Excluded From Build" to yes

0

精彩评论

暂无评论...
验证码 换一张
取 消