PDA

View Full Version : debug OK, release kaput - same code.



Silas Tomkyn Combermache
20th July 2010, 19:24
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,

squidge
20th July 2010, 19:46
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.

Zlatomir
20th July 2010, 20:54
The correct .dll files can be found in: QT_INSTALL_FOLDER\qt\bin
not the ones from QT_INSTALL_FOLDER\bin