Results 1 to 3 of 3

Thread: debug OK, release kaput - same code.

  1. #1
    Join Date
    Jul 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default debug OK, release kaput - same code.

    Hello, this is my first post.
    I am a cpp wannabee, but I have compiled c and basic for a while (hobbyist-student).
    The source code is from the official Qt book, second editon, chapter two - the find dialog.
    I am using Visual Studio 2008 with the binary download plugin.
    The problem is that the executable from the release version causes a catastrophic error, and crashes.
    The executable from the debug configuaration runs just fine, and there is no source code difference.
    I have attached a screen copy of the error dialog, and the build log.

    There is no compile error message (default error report setting) when I build the release version, but I found a curious error in the build log (html) file:
    ":VCReportError
    echo Project : error PRJ0019: A tool returned an error code from "Moc'ing finddialog.h..."
    exit 1
    :VCEnd"

    However, the exe file is created despite this error, but it has the problem I mentioned. The same source code works fine in the QtCreator ide, both debug and release (of course).

    The Visual Studio setup should be good because I can create Qt project solutions from scratch, from Qt pro files, and from the provided examples and they build and run successfully. I just can't think what could be going on here. Is it some kind of meta object compiler snafu?
    Thanks,
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    6
    Thanked 348 Times in 333 Posts

    Default Re: debug OK, release kaput - same code.

    The problem is as is stated - the DLL used for the release version is incorrect for your application. Please put a copy of the correct version of QtGUI4.dll in the same folder as your application and all will be well. You will find several on your PC, try them all until you come across one that works.

  3. #3
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android
    Thanks
    62
    Thanked 260 Times in 246 Posts

    Default Re: debug OK, release kaput - same code.

    The correct .dll files can be found in: QT_INSTALL_FOLDER\qt\bin
    not the ones from QT_INSTALL_FOLDER\bin
    Last edited by Zlatomir; 20th July 2010 at 22:20.

Similar Threads

  1. Debug or Release mode in MAC
    By ssaa in forum Installation and Deployment
    Replies: 6
    Last Post: 9th March 2010, 06:15
  2. Release ok, debug crashes [compilable code]
    By Raccoon29 in forum Qt Programming
    Replies: 8
    Last Post: 16th December 2009, 16:48
  3. debug vs. release in static
    By null_pointer in forum Newbie
    Replies: 1
    Last Post: 16th October 2007, 09:34
  4. Why not on release but debug
    By baray98 in forum Qt Programming
    Replies: 6
    Last Post: 10th August 2007, 10:08
  5. Debug and Release
    By paranoid_android in forum Qt Programming
    Replies: 5
    Last Post: 18th November 2006, 14:58

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
  •  
Qt is a trademark of The Qt Company.