简体   繁体   中英

Qt — program that uses SQLite crashes

I have an application that uses SQLite via Qt libraries (I mean QSqlDatabase). When I run this application from Qt Creator (both in Debug and Release configurations), all works as expected, but when I trying to start an application via .exe file manually, it crashes right after SQLite database operations. I already have "sqldrivers" directory with "qsqlite.dll" file right next to the executable. There's no exception, because I already have a try-catch block around the function that works with SQLite.

What am I doing wrong? How can I fix it?

I'm using Qt5 and MSVC-11.0

Thanks in advance.

It crashes ... due what? (access violation, assertion)

you can add some logging to see how far your code executes before refusing its job. using QTextStream , a redirected qDebug() , std::ofstream or even a fprintf() call will do.

btw Qt does not use exceptions due compatibility to some platforms ...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM