Qt + Mysql Embedded, compiles fine but crashes (exit code 1) on db.open() call
Hello all,
I’m trying to work with mysql Embedded drive on qt using VS2010.. everything compiles well, and the dll seem to lead fine, here is the output:
- 'QTMysqlTest.exe': Loaded 'C:\Deve\CPP\QTDBLayer\QTMysqlTest.exe', Symbols loaded.
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'D:\Deve\QT\qt4.7.1\bin\QtCored4.dll', Symbols loaded.
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\ws2_32.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\nsi.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Deve\QT\qt4.7.1\bin\QtSqld4.dll', Symbols loaded.
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'D:\Deve\QT\qt4.7.1\plugins\sqldrivers\qsqlmysqld4.dll', Symbols loaded.
- 'QTMysqlTest.exe': Loaded 'C:\mysql-5.1.30-win32\Embedded\DLL\debug\libmysqld.dll', Symbols loaded. //notice it's loading this dll, no path issue
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\wsock32.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\nlaapi.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\mswsock.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\dnsapi.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\winrnr.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\NapiNSP.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\pnrpnsp.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\wshbth.dll', Cannot find or open the PDB file
- 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\rasadhlp.dll', Cannot find or open the PDB file
- The thread 'Win32 Thread' (0x1688) has exited with code 1 (0x1).
- The thread 'Win32 Thread' (0x154c) has exited with code 1 (0x1).
- The thread 'Win32 Thread' (0x1524) has exited with code 1 (0x1).
- The thread 'Win32 Thread' (0x1230) has exited with code 1 (0x1).
- The thread 'Win32 Thread' (0x16e8) has exited with code 1 (0x1).
- The program '[5484] QTMysqlTest.exe: Native' has exited with code 1 (0x1).
———————
here is the code:
- #include <QtCore/QCoreApplication>
- #include <QtSql>
- #include <QtDebug>
- int main(int argc, char *argv[])
- {
- db.setHostName("localhost");
- db.setDatabaseName("mysql");
- db.setUserName("root");
- db.setPassword("root");
- bool gotOk = false;
- gotOk = db.open(); //crashes here
- if( gotOk )
- {
- qDebug() << db.lastError();
- qFatal( "Failed to connect." );
- }
- else
- {
- qDebug() << db.connectionName();
- }
- db.close();
- return 0;
- }
sqlite works fine, BTW, so I’m not sure that the windows 7 64bit has any effect here.
also, note that I’m using both in the test and in the qt libraries with Runtime Libraries flag /MTd and not /MDd so it might be there.
any ideas?
Thanks
3 replies
OMG! u are right, I feel so stupid, sorry.
I wrote a new thread with a more up to date status, it was moved by the moderator to this place [developer.qt.nokia.com]
You must log in to post a reply. Not a member yet? Register here!

