February 26, 2011

Mr.G Mr.G
Lab Rat
44 posts

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:

  1. 'QTMysqlTest.exe': Loaded 'C:\Deve\CPP\QTDBLayer\QTMysqlTest.exe', Symbols loaded.
  2. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
  3. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
  4. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
  5. 'QTMysqlTest.exe': Loaded 'D:\Deve\QT\qt4.7.1\bin\QtCored4.dll', Symbols loaded.
  6. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Cannot find or open the PDB file
  7. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Cannot find or open the PDB file
  8. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Cannot find or open the PDB file
  9. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Cannot find or open the PDB file
  10. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Cannot find or open the PDB file
  11. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Cannot find or open the PDB file
  12. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Cannot find or open the PDB file
  13. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Cannot find or open the PDB file
  14. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Cannot find or open the PDB file
  15. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Cannot find or open the PDB file
  16. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Cannot find or open the PDB file
  17. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\ws2_32.dll', Cannot find or open the PDB file
  18. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\nsi.dll', Cannot find or open the PDB file
  19. 'QTMysqlTest.exe': Loaded 'C:\Deve\QT\qt4.7.1\bin\QtSqld4.dll', Symbols loaded.
  20. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Cannot find or open the PDB file
  21. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Cannot find or open the PDB file
  22. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Cannot find or open the PDB file
  23. 'QTMysqlTest.exe': Loaded 'D:\Deve\QT\qt4.7.1\plugins\sqldrivers\qsqlmysqld4.dll', Symbols loaded.
  24. '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
  25. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\wsock32.dll', Cannot find or open the PDB file
  26. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\nlaapi.dll', Cannot find or open the PDB file
  27. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\mswsock.dll', Cannot find or open the PDB file
  28. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\dnsapi.dll', Cannot find or open the PDB file
  29. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\winrnr.dll', Cannot find or open the PDB file
  30. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\NapiNSP.dll', Cannot find or open the PDB file
  31. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\pnrpnsp.dll', Cannot find or open the PDB file
  32. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\wshbth.dll', Cannot find or open the PDB file
  33. 'QTMysqlTest.exe': Loaded 'C:\Windows\SysWOW64\rasadhlp.dll', Cannot find or open the PDB file
  34. The thread 'Win32 Thread' (0x1688) has exited with code 1 (0x1).
  35. The thread 'Win32 Thread' (0x154c) has exited with code 1 (0x1).
  36. The thread 'Win32 Thread' (0x1524) has exited with code 1 (0x1).
  37. The thread 'Win32 Thread' (0x1230) has exited with code 1 (0x1).
  38. The thread 'Win32 Thread' (0x16e8) has exited with code 1 (0x1).
  39. The program '[5484] QTMysqlTest.exe: Native' has exited with code 1 (0x1).

———————
here is the code:
  1. #include <QtCore/QCoreApplication>
  2. #include <QtSql>
  3. #include <QtDebug>
  4.  
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8.  QCoreApplication a(argc, argv);
  9.  QString connectionName = "DbThread-" + QDateTime::currentDateTime().toString("yyyyMMddhhmmsszzz");
  10.  QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL", connectionName);
  11.         db.setHostName("localhost");
  12.         db.setDatabaseName("mysql");
  13.         db.setUserName("root");
  14.         db.setPassword("root");
  15.  bool gotOk = false;
  16.  gotOk = db.open(); //crashes here
  17.  if( gotOk )
  18.  {
  19.   qDebug() << db.lastError();
  20.   qFatal( "Failed to connect." );
  21.  }
  22.  else
  23.  {
  24.   qDebug() << db.connectionName();
  25.  }
  26.  
  27.  db.close();
  28.  return 0;
  29. }

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

5 replies

September 23, 2011

Mr.G Mr.G
Lab Rat
44 posts

I have the same problem, where u able to find a solution?

Thanks

September 23, 2011

Lukas Geyer Lukas Geyer
Lab Rat
2074 posts

Well, it’s getting late but is it possible that you are the OP of this thread?

September 23, 2011

Mr.G Mr.G
Lab Rat
44 posts

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]

June 18, 2014

ApsarF ApsarF
Lab Rat
1 posts

Hi i m new into .Net environment I’m facing this issue when I m trying to build an desktop application.

Error 2 The command ““C:\Program Files (x86)\Microsoft\ILMerge\ilmerge.exe” /target:winexe /out:E:\DotNet\blu – Bulk Lead Upload -Apsar\2012-08-30.01-d-vs-pc-dg-all\BulkLeadUpload\BulkLeadUpload\bin\Release\..\..\..\..\publish\BulkLeadUploadSingleV1.0.exe E:\DotNet\blu – Bulk Lead Upload -Apsar\2012-08-30.01-d-vs-pc-dg-all\BulkLeadUpload\BulkLeadUpload\bin\Release\BulkLeadUpload.exe E:\DotNet\blu – Bulk Lead Upload -Apsar\2012-08-30.01-d-vs-pc-dg-all\BulkLeadUpload\BulkLeadUpload\bin\Release\..\..\dll\MySql.Data.dll” exited with code 1. BulkLeadUpload

June 18, 2014

SGaist SGaist
Mad Scientist
9438 posts

Hi and welcome to devnet,

What does it have to do with Qt ?

 Signature 

Need programers to hire ? www.edeltech.ch

 
  ‹‹ Signals/slots in Qt Creator QMainWindow-based project for mobile - HOW?      Creating editable UI and linking it with C/C++ library fucntions ››

You must log in to post a reply. Not a member yet? Register here!