[Split] Debug vs. Release

  • I have another question. If this problem is hard to solve( my another thread: http://developer.qt.nokia.com/forums/viewthread/9300/ ), is it possible to give another people to use my software, compiled in debug mode??? Are there many differencies between debug and release mode?

    [Edit: Split this into its own thread. Please use new threads for new topics; mlong]

  • Debug mode includes debug information, which are necessary to debugging software (like gdb) in order to work properly (setting up breakpoints and watchpoints, for example). One drawback is that an executable compiled in debug mode will occupy more disk space.
    It's better to give people your source code and let them build it in debug mode, on their own.

  • If I don't use breakpoints, watchpoints, how much more circa disk space it will use?

  • I wasn't clear, sorry. Breakpoints and watchpoints are set up by specific command in the debugger, during the debugging process, they do not affect size of the executable.
    Debug information (symbols) are used by the debugger to detect memory location for variables and instructions.
    To give you an idea, I have a small application which if compiled in debug mode takes 697 KiB, if compiled in release mode takes 295 KiB. For larger projects (more files, classes and functions), it may increase.
    I have compiled a "big" application in debug mode, size is 20.4 MiB. In release it's only 2.3 MiB.
    Just to give you an idea of the difference between release and debug ;-)

  • Be aware, that you might not be allowed to distribute debug versions of your applications and/or the need libraries due to licensing restrictions!

    At least for Visual Studio this is not possible:

    bq.. From http://msdn.microsoft.com/en-us/library/8kche8ah.aspx

    You cannot redistribute all of the files that are included in Visual Studio; you are only permitted to redistribute the files that are specified in Redist.txt. Debug versions of applications and the various Visual C++ DLLs are not redistributable.

    p. If your test users do not have a debugger running, why do you want to distribute a debug version of your application?

  • I don't use Visual C++ DLLs(I use MinGW compiler, Qt Creator(Qt dll's), swedll32.dll(GNU GPL License)). I want to distribute a debug version, because it is working always correct without any problems. Release version crashed and nowbody know why(I try to solve this problem myself more, than 2 weeks, but I cann't / I have an small example in this topic http://developer.qt.nokia.com/forums/viewthread/9300/ ). I can distribute debug version or try to change Gui toolkit or(and) Compiler, but I like Qt. I don't see another choices.

  • Regarding MinGW and Qt there is no restriction that I'm aware of (I'm not a lawyer!).

  • I would advise against distributing a debug version because it happens to work when the release version does not. That indicates that there is still a bug in your code, but (possibly just by chance) the debug version is masking it, with the possibility that it might show itself at another time when least expected.

  • And (additionally) Qt debug dlls are really huge (QtCore 2,5 MB release, 30 MB debug, QtGui 95, MB release, 150 MB debug). Regarding only those 2 dlls, it makes absolutly no sense to distribute debug versions. I suggest you try to find the bug by debugging your app and solve it.

  • mlong, Gefolf can you may be see my small example ( last post in thread: http://developer.qt.nokia.com/forums/viewthread/9300/ ) and say, what I do wrong? Where can bug be??? I cann't find myself, what I do wrong in this(small) example too....

    I think, that it is a compiler problem or I'm too stupid to find my bug.

Log in to reply