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. Release vs Debug

Release vs Debug

Scheduled Pinned Locked Moved C / C++ / MFC
announcementvisual-studiodebugginghelpquestion
9 Posts 4 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.
  • J Offline
    J Offline
    John Uhlenbrock
    wrote on last edited by
    #1

    The debug version of my program works like a charm. The release build gives an access violation as soon as I double click on the exe. So....since I really can't "debug" the release version, I could use a lil help. Any ideas?

    RaviBeeR J R 3 Replies Last reply
    0
    • J John Uhlenbrock

      The debug version of my program works like a charm. The release build gives an access violation as soon as I double click on the exe. So....since I really can't "debug" the release version, I could use a lil help. Any ideas?

      RaviBeeR Offline
      RaviBeeR Offline
      RaviBee
      wrote on last edited by
      #2

      You probably have an uninitialized variable. Try using AfxMessageBox() to trace through your program. /ravi "There is always one more bug..." http://www.ravib.com ravib@ravib.com

      1 Reply Last reply
      0
      • J John Uhlenbrock

        The debug version of my program works like a charm. The release build gives an access violation as soon as I double click on the exe. So....since I really can't "debug" the release version, I could use a lil help. Any ideas?

        J Offline
        J Offline
        John Uhlenbrock
        wrote on last edited by
        #3

        I just found out you CAN debug your release build. Under MSDN help, under index, look up "release build" and under that is "fixing problemss" (yes 2 s's). Click on "Turn on Generation of Debug Information for the Release Build" to find out how. So, I did that, and I am now debugging the release build, and I find out that my "Access violation" error comes before the first line of InitInstance. What on gods planet would cause this? The call stack just shows "0064ed69()".

        B 1 Reply Last reply
        0
        • J John Uhlenbrock

          I just found out you CAN debug your release build. Under MSDN help, under index, look up "release build" and under that is "fixing problemss" (yes 2 s's). Click on "Turn on Generation of Debug Information for the Release Build" to find out how. So, I did that, and I am now debugging the release build, and I find out that my "Access violation" error comes before the first line of InitInstance. What on gods planet would cause this? The call stack just shows "0064ed69()".

          B Offline
          B Offline
          Brad Bruce
          wrote on last edited by
          #4

          Sounds like you have a member variable that is blowing up as it's being created.

          J 1 Reply Last reply
          0
          • J John Uhlenbrock

            The debug version of my program works like a charm. The release build gives an access violation as soon as I double click on the exe. So....since I really can't "debug" the release version, I could use a lil help. Any ideas?

            R Offline
            R Offline
            Rafael Gomez Blanes
            wrote on last edited by
            #5

            For strange it seems, you can debug a release version of a program in VC; read the article on http://www.pgh.net/~newcomer/debug\_release.htm; very good!

            1 Reply Last reply
            0
            • B Brad Bruce

              Sounds like you have a member variable that is blowing up as it's being created.

              J Offline
              J Offline
              John Uhlenbrock
              wrote on last edited by
              #6

              Well, I don't hear any explosions ;D. On a serious note, could you elaborate on this variable "blowing up"?

              B 1 Reply Last reply
              0
              • J John Uhlenbrock

                Well, I don't hear any explosions ;D. On a serious note, could you elaborate on this variable "blowing up"?

                B Offline
                B Offline
                Brad Bruce
                wrote on last edited by
                #7

                I hope this equation works here ;) Quick Answer + time + thought = better answer Try setting a breakpoint in the constructor of any class member classes. For example, you have a class CDoSomething which is declared as a member variable of CMyGreatClass. Notice I said class not pointer to a class. As a part of the construction of CMyGreatClass, it has to create CDoSomething. If there is a problem creating CDoSomething, CMyGreatClass will not even get created before an error occurs. Good Luck Brad

                J 1 Reply Last reply
                0
                • B Brad Bruce

                  I hope this equation works here ;) Quick Answer + time + thought = better answer Try setting a breakpoint in the constructor of any class member classes. For example, you have a class CDoSomething which is declared as a member variable of CMyGreatClass. Notice I said class not pointer to a class. As a part of the construction of CMyGreatClass, it has to create CDoSomething. If there is a problem creating CDoSomething, CMyGreatClass will not even get created before an error occurs. Good Luck Brad

                  J Offline
                  J Offline
                  John Uhlenbrock
                  wrote on last edited by
                  #8

                  I thought that the very very very first thing that gets called is CMyApp::InitInstance(). I attempt to "run to cursor" to that function with my release build, and it doesn't make it. Do the constructors of the other classes get called before reaching the InitInstance function....? ( I also tried your suggestion, without success.

                  B 1 Reply Last reply
                  0
                  • J John Uhlenbrock

                    I thought that the very very very first thing that gets called is CMyApp::InitInstance(). I attempt to "run to cursor" to that function with my release build, and it doesn't make it. Do the constructors of the other classes get called before reaching the InitInstance function....? ( I also tried your suggestion, without success.

                    B Offline
                    B Offline
                    Brad Bruce
                    wrote on last edited by
                    #9

                    The constructor gets called first! Try setting a breakpoint there. Brad

                    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