Can't deploy Qt application with QMYSQL - c++

I have an application that requires to connect to MySQL database, I am using Qt 4.7. I built the QMYSQL plugin and everything works just fine ON MY MACHINE. When I tried to test the application on another machine with the folder "sqldrivers" contains the "qsqlmysql4.dll" next to my executable. I get this error "Driver not loaded". After hours of searching the web and following the Qt documentation I came up with nothing.
Please tell me what am I missing.

Is there an actual mysql client DLL (like libmysqlclient.dll or something) that's installed on your machine, and also needs to be included with the app?

Related

Amazon aws missing dlls (MSVCP140, VCRUNTIME140, CONCRT140)

I made an web server app, that should reside on amazon aws vitual machine with win10.
When i trying execute this app, it says that it missing dlls (MSVCP140, VCRUNTIME140, CONCRT140)
In the app i use cpprestsdk, cryptocpp, opencv.
I try to install various visual C++ redistributables, but its not gave the result.
Downloaded this dlls separately and put it into system32 foled ,but either no result.
When i put dlls in app folder it gave me the error that app was unable to start correctly (0xc0000007b).
Tryed to execute app builded with /MT flag (it actually dont remove all the dlls) and problem is still there
Amazon instance type is t2.micro

Connecting Qt5 and Firebird 2.5

I'm a newbie at c++ linking and databases, so may be i'm asking a really stupid question. Anyway, i'm trying to access to firebird database using Qt5 for Windows. I've checked google and found 2 ways of doing so:
build ibase driver from Qt source;
use firebird through ODBC driver.
Software versions
I'm using latest version of Qt: 5.1.1. Firebird 2.5 is working ok: i've create a test_base and test user admin. Administartion of test_base i've done through FlameRobin.
Building
I've downloaded qt5.1.1 source and unpacked it in c:/devtools/qt5.1.1-src. Since Qt4.7-4.8 folder and project structure has been changed so old FAQs cannot be applied here. So i tried to build sql.pro from qtbase\src\sql folder with 2 lines added:
INCLUDEPATH+= C:/devtools/firebird/firebird_2_5/include
LIBS+= C:/devtools/firebird/firebird_2_5/lib/fbclient_ms.lib
And i've added C:/devtools/firebird/firebird_2_5/lib/ and C:/devtools/firebird/firebird_2_5/include in system PATH. Compilation is done without any error and i get a qt_pch.h.gch\c++ file in build dir. And i have no idea what's to do next, because i hoped to have bunch of .a and .dll files or bunch of error at least.
Using ODBC driver
I've downloaded and installed firebird ODBC driver from here. Installation was successful and i created ODBC DSN source mydb in Windows ODBC manager. Test connection button from ODBC configurator says that everything is ok.
Next thing i did was opening SQL Browser example from Qt Creator. And it fails to open my ODBC base with following parameters:
Driver: QODBC
Database Name: mydb
Username: admin
Password: admin
Hostname: localhost
Port: Default
And i get an error message: "[ODBC Firebird Driver] Unable to connect to data source: library 'C:\devtools\Firebird\Firebird_2_5\bin\fbclient.dll' failed to load QODBC3: Unable to connect".
I'm looking for resolving any of this two issues. Thanks in advance.
upd: i've connected firebird database through ODBC: the error was in using x64 database with x86 QODBC. Nota bene: in order to manage x86 DSN ODBC in x64 Windows 7 one must run ODBC manager from %WINDIR%\SysWOW64\odbcad32.exe NOT from Administration Panel as it explained here.
But what about building ibase from qt source?

How Remote Development of C++ works in Netbeans?

Hi we want to use remote development features of netbeans but while trying out on our setup its very slow. I want to understand its feasibility of integrating our build environment with netbeans.
Our setup would be normally:
1. Windows 7 Professional 64bit where we install netbeans
2. RHEL 5.5 64bit linux where we have tools and sources
Normally we directly connect to that machine through PuTTY and use VIM to edit sources and gmake to compile and build projects. Now when I created the "New Remote Project with existing sources" and try to use it It took more time to load the project.
So Can anybody tell me how actually this remote compilation works??
Because we have some GBs of sources here on linux box and I want to know is it possible for smooth development with this big data??
Simple steps. Read this tutorial. You just need a SSH-server on your Linux.
The process is easy, your Netbeans connects to the SSH-server and searches for compilation tools then uses them to build your projects.
The second issue is creating a shared folder that your Windows and Linux able to access to it. I suggest you first create a shared folder on your Windows and use Samba client on your Linux.

Qt database drivers

I built qt with -plugin-sql-mysql -plugin-sql-sqlite flags. I have libqsqlmysql.a and libqsqlite.a. I use qt in my project. But my build system is not qt, I use waf.
I have the following problem when I try to run my application which establishes connection with mysql database:
QSqlDatabase: QMYSQL driver not loaded
QSqlDatabase: available drivers:
QSqlDatabase: an instance of QCoreApplication is required for loading driver plugins
INFO - Failed to connect to root mysql admin
I added -lqsqlmysql to compiler options when I build the app.
Can you please explain how qt drivers work, how and when it tries to load driver. What is a qt driver (dll, lib, ....)?
I think your app is trying to load the database plugin dynamically, from a DLL. This document will help you find the appropriate location for the database driver DLL. Alternatively, you could link your app against the plugin statically, here's how.
Qt has plugins for several types of databases and these plugins are located in the following location:
$(QTDIR)/plugins/sqldrivers
First check if mysql plugin is present there. If plugin is not there then it means you didn't compile Qt properly, so you should recompile Qt with enabled MySql plugin. Otherwise probably your application doesn't load mysql plugin properly. Qt plugins are loaded dynamically during initialization of application i.e when QSqlDatabase object will be initialized. If plugin location is not set properly then none of plugins will be loaded. You can check location where your application expect to find plugins via following Qt API:
QStringList QCoreApplication::libraryPaths ()
If application doesn't point to right location you can set plugin path by calling of:
void QCoreApplication::addLibraryPath ( const QString & path )
 
Or by creation of qt.conf file in folder where your executable is placed. In this file you can configure plugins location in the following way:
[Paths]
Plugins = %pluginlocation%

Windows, Mingw Qt Application Does Not Run On Deployed Computers

I have created a Qt application with Mingw. The application runs properly on the development computer after copying the required DLL's to the directory. However, when deploying on external computers, the application does not run at all.
Update:
In addition, the application uses Sqlite3 via QtSql.
It's quite likely you're still missing some dll.
Check the Windows event log for any errors after running the application. (Administrative Tools->Event Viewer).
Try launching the application from a command prompt window.
Try Dependency Walker.
Another thought is some missing configuration file or registry settings.
Double check against the Qt docs for deploying Windows Qt applications.