Results 1 to 9 of 9

Thread: A question about compiling in debug mode and in release mode

  1. #1
    Join Date
    Oct 2007
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default A question about compiling in debug mode and in release mode

    Hello to all

    I know this might be a stupid question for some but what is the difference between compiling in release and debug mode.This should not affect the final executable file ??.
    Is it necessary to compile in debug mode.

    Yours Respectfully

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: A question about compiling in debug mode and in release mode

    It will affect the executable. Debug mode is necessary for debugging with a debugger (unless you like reading assembler code). If you compile your project in this mode, it will contain additional information for the debugger and also it enables some checks inside Qt, that will allow you to identify problems more easily.

  3. #3
    Join Date
    Oct 2007
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: A question about compiling in debug mode and in release mode

    The reason why i asked is because when i build the Qt libraries in debug mode i get this at the end:
    \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

    Qt is now configured for building. Just run mingw32-make.
    To reconfigure, run mingw32-make confclean and configure.
    (cd C:\Qt\4.3.1\src\winmain && mingw32-make -f Makefile debug)
    mingw32-make[1]: Entering directory `C:/Qt/4.3.1/src/winmain'
    mingw32-make -f Makefile.Debug
    Makefile.Debug:116: *** multiple target patterns. Stop.
    mingw32-make[2]: Entering directory `C:/Qt/4.3.1/src/winmain'
    mingw32-make[2]: Leaving directory `C:/Qt/4.3.1/src/winmain'
    mingw32-make[1]: *** [debug] Error 2
    mingw32-make[1]: Leaving directory `C:/Qt/4.3.1/src/winmain'
    mingw32-make: *** [debug-C__Qt_4_3_1_src_winmain] Error 2
    C:\Qt\4.3.1\src>



    What does this mean especially where the lines mention "error"Also in the C:\Qt\examples..... There are no files in the "debug" folder,only in the "release" folder.
    Does this mean that the building of the debug libraries failed?

    When I run command "make release" i get a perfect executable in the release folder.

    However when I type "make debug" or "make" I get the following error


    C:\works>make debug
    mingw32-make -f Makefile.Debug
    mingw32-make[1]: Entering directory `C:/works'
    g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-rel
    oc -mthreads -Wl -Wl,-subsystem,windows -o "debug\works.exe" debug\yogi.o -L"c:
    \Qt\4.3.1\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
    C:\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\ mingw32\bin\ld.exe: cannot fin
    d -lqtmaind
    collect2: ld returned 1 exit status
    mingw32-make[1]: *** [debug\works.exe] Error 1
    mingw32-make[1]: Leaving directory `C:/works'
    mingw32-make: *** [debug] Error 2

    C:\works>


    I am a bit fedup trying to resolve this,so guys please help me out.

    Yours Respectfully

  4. #4
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    300
    Thanks
    9
    Thanked 29 Times in 29 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: A question about compiling in debug mode and in release mode

    Not sure about the error. But there is one more difference between debug mode and release mode for compilers. Debug mode generally compiles faster and runs slower than release mode.
    "The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: A question about compiling in debug mode and in release mode

    Quote Originally Posted by Michiel View Post
    Debug mode generally compiles faster and runs slower than release mode.
    It's because release mode does by default much more optimisations. That's why it is called release - when you are releasing a project, you compile in release mode. Contrary to that you compile in debug mode when you debug.

    @Yogibear: You don't have debug libraries built (the "d" at the end of the library name marks it as debug).

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: A question about compiling in debug mode and in release mode

    Quote Originally Posted by Yogibear View Post
    when i build the Qt libraries in debug mode i get this at the end:[...]
    What commands did you issue exactly?

  7. #7
    Join Date
    Oct 2007
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: A question about compiling in debug mode and in release mode

    I am using windows so I just go to the shortcut in programs and click on Qt and then click on build debug libraries(command prompt) and just type "y" to agree to the license and just let the program run until it stops at this error.

    Did i do something wrong?

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: A question about compiling in debug mode and in release mode

    Quote Originally Posted by Yogibear View Post
    Did i do something wrong?
    No, it seems that you are experiencing the same problem as in this thread: http://www.qtcentre.org/forum/f-inst...tall-9457.html

  9. #9
    Join Date
    Oct 2007
    Posts
    9
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: A question about compiling in debug mode and in release mode

    I have suceeded,thanks to all

Similar Threads

  1. Difference between Debug and Release Mode
    By sunil.thaha in forum Qt Programming
    Replies: 2
    Last Post: 5th May 2013, 13:31
  2. qodbc driver not loaded error in release mode
    By mandal in forum Qt Programming
    Replies: 1
    Last Post: 14th November 2006, 09:42
  3. Error compiling Qt 4.0 in Debug mode
    By Doug Broadwell in forum Installation and Deployment
    Replies: 1
    Last Post: 11th October 2006, 08:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.