PDA

View Full Version : Memory warning within windows



Harvey West
12th September 2007, 12:40
I've recently upgraded to 4.2.2 But now i'm getting heap memory warnings. Can't seem to see whats causing it. Any ideas?

Could this have anything to do with linking c:\Qt\4.2.2\lib\QtSql4.lib?

Harvey

################################################## #######
db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName(hostName);
db.setPort(port);
db.setDatabaseName(databaseName);
db.setUserName(userName);
db.setPassword(password);
.
.
.
.

QString test = db.lastError().text();
qDebug() << "DB open failed: " << test; // OK

qDebug() << "DB open failed: " << db.lastError().text(); //Causes error to flag see below

################################################## #######
Debug errors:
HEAP[foo.exe]: Invalid Address specified to RtlValidateHeap( 00B60000, 00B7A108 )
Windows has triggered a breakpoint in foo.exe.

This may be due to a corruption of the heap, and indicates a bug in foo.exe or any of the DLLs it has loaded.

Harvey West
12th September 2007, 14:22
Hello

Can Qt projects be built in Visual studio 2005 Debug mode?

I have no problems building the project as a "Release binary". But as soon as I try and build a "Debug binary" version I get very annoying trigger point windows popping up. Is this normal?

Is anyone using Visual studio 2005 in debug mode?

Harvey

wysota
12th September 2007, 21:52
Do you have all the plugins and libs compiled in debug mode as well?

Harvey West
13th September 2007, 11:59
I have used this file qt-win-commercial-4.2.2-vs2005.exe to install qt.
Only use the dll libs that came with this install i.e. Did not do a recompile. Should I?

I then build the project like so .....

qmake -project -t vcapp
qmake foo.pro

I then edit foo.pro. See red text .....

################################################## ####################
# Automatically generated by qmake (2.01a) Tue 11. Sep 16:55:27 2007
################################################## ####################

TEMPLATE = vcapp
TARGET =
DEPENDPATH += .
INCLUDEPATH += . C:\PROJECTS\Toolbar\include
win32:LIBS += C:\PROJECTS\Toolbar\lib\WS2_32.Lib

# Input
HEADERS += quemanager.h spreadsheet.h tasksthread.h track.h
SOURCES += main.cpp quemanager.cpp spreadsheet.cpp tasksthread.cpp track.cpp

QT += xml sql network
CONFIG += debug
################################################## ####################

I then go into vs2005 and add include directories & additional dependencies to the project settings. Like so ....
c:\Qt4.2.2\include\QtXml
c:\Qt4.2.2\include\QNetwork
c:\Qt4.2.2\include\QtSql


c:\Qt\4.2.2\lib\QtSql4.lib
c:\Qt\4.2.2\lib\QtNetwork4.lib
C:\Qt\4.2.2\lib\QtXml4.lib
C:\PROJECTS\Toolbar\lib\WS2_32.Lib

Does this look all quite normal?

Some ones mentioned Qts intergration kit. Whats this?

Cheers

Harvey

wysota
13th September 2007, 14:58
If you want to use debug libraries, plugins have to be compiled in debug mode as well. So if you don't have those compiled in debug mode, you'll have to do that first.

Harvey West
13th September 2007, 19:18
Arrrr

So the qt-win-commercial-4.2.2-vs2005.exe only comes with release dll/libs. no debug dll/libs.

If i want to compile for debug will i need to install MinGW?

Tried VS2005 "nmake.exe" but this does not seem to work.

wysota
13th September 2007, 19:26
No, you just need Qt's source code which you should be able to download from your restricted area on Trolltech site if it's not included in the above mentioned archive. Then run configure and nmake sub-src.

Harvey West
14th September 2007, 11:33
Tried running configure but get this. Any ideas?

See attached file.

spud
14th September 2007, 11:53
I think nmake can't find cl.exe. Did you use a normal console? You have to use the "Visual Studio 2005 Command Prompt".