Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. MFC

MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
16 Posts 8 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    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

    A L L C A 7 Replies Last reply
    0
    • L Lost User

      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

      A Offline
      A Offline
      Albert Holguin
      wrote on last edited by
      #2

      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.

      L 1 Reply Last reply
      0
      • L Lost User

        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

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        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

        L 1 Reply Last reply
        0
        • A Albert Holguin

          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.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Thanks for the reply. I am hitting 'Build Solution', not 'Rebuild Solution'. Where is the incremental build setting?

          A 1 Reply Last reply
          0
          • L Lost User

            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

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Thanks for your reply. These classes are base classes; the active classes I am constantly working on are derived from these files.

            L 1 Reply Last reply
            0
            • L Lost User

              Thanks for your reply. These classes are base classes; the active classes I am constantly working on are derived from these files.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              • L Lost User

                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

                L Offline
                L Offline
                Lakamraju Raghuram
                wrote on last edited by
                #7

                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

                N 1 Reply Last reply
                0
                • L Lost User

                  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

                  C Offline
                  C Offline
                  Chris Losinger
                  wrote on last edited by
                  #8

                  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.

                  image processing toolkits | batch image processing

                  1 Reply Last reply
                  0
                  • L Lost User

                    Thanks for the reply. I am hitting 'Build Solution', not 'Rebuild Solution'. Where is the incremental build setting?

                    A Offline
                    A Offline
                    Albert Holguin
                    wrote on last edited by
                    #9

                    It's in the project settings... Same place where you would select the linking options for MFC.

                    1 Reply Last reply
                    0
                    • L Lost User

                      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

                      A Offline
                      A Offline
                      Aescleal
                      wrote on last edited by
                      #10

                      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

                      A 1 Reply Last reply
                      0
                      • L Lost User

                        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

                        A Offline
                        A Offline
                        Alan Balkany
                        wrote on last edited by
                        #11

                        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!"

                        1 Reply Last reply
                        0
                        • L Lakamraju Raghuram

                          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

                          N Offline
                          N Offline
                          Nelek
                          wrote on last edited by
                          #12

                          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.

                          1 Reply Last reply
                          0
                          • L Lost User

                            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

                            J Offline
                            J Offline
                            JohnCz
                            wrote on last edited by
                            #13

                            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

                            L 1 Reply Last reply
                            0
                            • J 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

                              L Offline
                              L Offline
                              Lost User
                              wrote on last edited by
                              #14

                              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!

                              J 1 Reply Last reply
                              0
                              • L Lost User

                                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!

                                J Offline
                                J Offline
                                JohnCz
                                wrote on last edited by
                                #15

                                You are welcome, glad to be of help.

                                JohnCz

                                1 Reply Last reply
                                0
                                • A Aescleal

                                  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

                                  A Offline
                                  A Offline
                                  Aescleal
                                  wrote on last edited by
                                  #16

                                  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.

                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • World
                                  • Users
                                  • Groups