MFC
-
I have several dozen classes that I do not touch/change yet every time I 'Build' MVS compiles them and it takes too long. Is there a way to tell the compiler not to compile classes I have not changed? Thanks
The compiler should already be doing this... are you sure you're not hitting rebuild instead of build? There should also be an incremental build option that you should have enabled in order to take advantage of this feature.
-
I have several dozen classes that I do not touch/change yet every time I 'Build' MVS compiles them and it takes too long. Is there a way to tell the compiler not to compile classes I have not changed? Thanks
Check your project settings under C/C++. Are these classes dependent on other files in your project?
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
-
The compiler should already be doing this... are you sure you're not hitting rebuild instead of build? There should also be an incremental build option that you should have enabled in order to take advantage of this feature.
-
Check your project settings under C/C++. Are these classes dependent on other files in your project?
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
-
Thanks for your reply. These classes are base classes; the active classes I am constantly working on are derived from these files.
As far as I am aware the default option in Visual Studio is to build only those modules that have changed since the last build, or which are dependent on some other file which has changed. All I can suggest is that you look closely at your project settings in the C/C++ section, and also all the dependencies for the files in question. Without seeing your actual project it's impossible to be more specific.
Binding 100,000 items to a list box can be just silly regardless of what pattern you are following. Jeremy Likness
-
I have several dozen classes that I do not touch/change yet every time I 'Build' MVS compiles them and it takes too long. Is there a way to tell the compiler not to compile classes I have not changed? Thanks
I totally agree with Richard MacCutchan's statement. I would be hard to analyze without peeking into your project organisation. Can you just compile the modified cpp alone (you can press ctrl+F7 or right-click on that cpp in the solution view and press compile) and see what other cpp's are compiling. In this way you can find the dependency of those cpp's with the current one
-
I have several dozen classes that I do not touch/change yet every time I 'Build' MVS compiles them and it takes too long. Is there a way to tell the compiler not to compile classes I have not changed? Thanks
i've had Visual Studio do that to me before. there's usually a file somewhere in there with a bad mod time. i always end up having to modify everything to get things back in sync.
-
Thanks for the reply. I am hitting 'Build Solution', not 'Rebuild Solution'. Where is the incremental build setting?
It's in the project settings... Same place where you would select the linking options for MFC.
-
I have several dozen classes that I do not touch/change yet every time I 'Build' MVS compiles them and it takes too long. Is there a way to tell the compiler not to compile classes I have not changed? Thanks
Are you sure you haven't got one or two files you're including just about everywhere, either directly or indirectly? In my experience this is the biggest killer of C++ app building time in the known universe. And beyond. Years ago it was common to have forbidden files that people wouldn't touch because you'd end up with 6 hour compilations if you did. MFC apps are really prone to this type of coupling as the framework is a bit 1990s and encourages implementation inheritance everywhere. If Chris L.'s comment about timestamps doesn't do it for you have a good what at what's including what and how you can break the dependencies. "Exceptional C++" by Herb Sutter and "Large Scale C++ design" by John Lakos go over how to reduce dependencies. Actually Lakos book is about nothing else and is a bit out of date so try "Exceptional C++" first. Cheers, Ash
-
I have several dozen classes that I do not touch/change yet every time I 'Build' MVS compiles them and it takes too long. Is there a way to tell the compiler not to compile classes I have not changed? Thanks
I've seen this behavior when a source file got a wrong future date because it was edited when the date on the PC was set incorrectly. After the date was corrected, the object file always appeared out of date since it never caught up with the source file from the "future".
"Microsoft -- Adding unnecessary complexity to your work since 1987!"
-
I totally agree with Richard MacCutchan's statement. I would be hard to analyze without peeking into your project organisation. Can you just compile the modified cpp alone (you can press ctrl+F7 or right-click on that cpp in the solution view and press compile) and see what other cpp's are compiling. In this way you can find the dependency of those cpp's with the current one
Another alternative is the http://www.dependencywalker.com/[^]
Regards. -------- M.D.V. ;) If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you Rating helpfull answers is nice, but saying thanks can be even nicer.
-
I have several dozen classes that I do not touch/change yet every time I 'Build' MVS compiles them and it takes too long. Is there a way to tell the compiler not to compile classes I have not changed? Thanks
Couple of things to consider: Is your project set for minimal rebuild? Are you using precompiled headers? If answer to any of the above is no or I don’t know check the following: Open the project's Property Pages dialog box. Click the C/C++ folder. Click the Code Generation property page. Make sure the Enable Minimal Rebuild property is set to yes(/Gm). Click on Precompiled header folder. Make sure that Create/Use Precompiled header is set to Use. . . (/Yu) Make sure that Create/Use PCH. . . is set to stdafx.h You may also need to check all source files iif they are set for precompiled header use. You can turn this on/off for every file in the project. Close the solution and delete .suo, .ncb files and Debug/Release directories, this will delete .idb (dependencies info file). Load the project and choose rebuild. Also check if any file in the project has the modification time set ahead of you local date/time (this may have been already addressed in one of the posts).
JohnCz
-
Couple of things to consider: Is your project set for minimal rebuild? Are you using precompiled headers? If answer to any of the above is no or I don’t know check the following: Open the project's Property Pages dialog box. Click the C/C++ folder. Click the Code Generation property page. Make sure the Enable Minimal Rebuild property is set to yes(/Gm). Click on Precompiled header folder. Make sure that Create/Use Precompiled header is set to Use. . . (/Yu) Make sure that Create/Use PCH. . . is set to stdafx.h You may also need to check all source files iif they are set for precompiled header use. You can turn this on/off for every file in the project. Close the solution and delete .suo, .ncb files and Debug/Release directories, this will delete .idb (dependencies info file). Load the project and choose rebuild. Also check if any file in the project has the modification time set ahead of you local date/time (this may have been already addressed in one of the posts).
JohnCz
Thanks for the response. This solved the problem: Close the solution and delete .suo, .ncb files and Debug/Release directories, this will delete .idb (dependencies info file). Load the project and choose rebuild. You made my day 10% more efficient; which is big. Thanks!
-
Thanks for the response. This solved the problem: Close the solution and delete .suo, .ncb files and Debug/Release directories, this will delete .idb (dependencies info file). Load the project and choose rebuild. You made my day 10% more efficient; which is big. Thanks!
-
Are you sure you haven't got one or two files you're including just about everywhere, either directly or indirectly? In my experience this is the biggest killer of C++ app building time in the known universe. And beyond. Years ago it was common to have forbidden files that people wouldn't touch because you'd end up with 6 hour compilations if you did. MFC apps are really prone to this type of coupling as the framework is a bit 1990s and encourages implementation inheritance everywhere. If Chris L.'s comment about timestamps doesn't do it for you have a good what at what's including what and how you can break the dependencies. "Exceptional C++" by Herb Sutter and "Large Scale C++ design" by John Lakos go over how to reduce dependencies. Actually Lakos book is about nothing else and is a bit out of date so try "Exceptional C++" first. Cheers, Ash
Hi person that voted this a 1. Any chance you could explain to me how I failed to do anything to help the conversation along? I'm particularly interested in knowing any factual errors I've made so I can learn from them and not make them again. Cheers, Ash PS: I don't do revenge down voting in case you're worried about some form of reprisals.