I get sqldriver error in QtCreator - qt

I try to write a program in Qt Creator using db library. When i run my application in Qt Creator, i get that error: "QSqlDatabase: QODBC driver not loaded
QSqlDatabase: available drivers: QSQLITE"
The qsqlodbc.dll and qsqlodbcd.dll files exist in the plugins/sqldrivers folder of the Qt 5.1.0 installation.
Why can not it find the driver altough it exits in the default installation?
Thanks

Related

qmlplugindump error when building with MinGW 64bits (Qt 5.13.1)

I built an extension plugin in release mode with MinGW 32bits (Qt 5.13.1).
When I run qmlplugindump everything works as expected and my .qmltypes file is well generated.
But when I build my plugin in release mode with MinGW 64bits (Qt 5.13.1) the qmlplugindump leads to the following error:
17:10:24: Starting: "C:\Qt\QtFramework\5.13.1\mingw73_64\bin\qmlplugindump.exe" -nonrelocatable NXSharedControllers 1.0 ...\NXSharedControllers > NXSharedControllers\nxsharedcontrollers.qmltypes
QQmlComponent: Component is not ready
file:///C:/Users/Documents/Qt_Main-d_5_13_1_MinGW_64bit/NX_SharedControllers/typelist.qml:3:1: plugin cannot be loaded for module "NXSharedControllers": Cannot load library C:\Users\Documents\Qt_Main-d_5_13_1_MinGW_64bit\NX_SharedControllers\NXSharedControllers\NXSharedControllersPlugin.dll: Unknown error 0x000000c1.
17:10:24: The process "C:\Qt\QtFramework\5.13.1\mingw73_64\bin\qmlplugindump.exe" exited with code 3.
Error while building/deploying project Qt_Main (kit: Desktop Qt 5.13.1 MinGW 64-bit)
When executing step "Custom Process Step"
Does it mean anything to someone ?
I have found the cause of this issue. A dependency file was missing from the plugin build folder. I created a custom target with QMake in order to copy the dependency file to this folder.

Unknown module(s) in QT: 3dstudioruntime2

I installed qt creator and qt 3dstudio with the qtOnline installer for linux. I want to build a project using these two packages. I design my project in qt3dstudio and then I use qtcreator to code the logic of the program. But I cannot import qt3dstudio module into the code.any suggestions??
I need to get this going on ubuntu 16.04LTS. I couldn't find anything useful on the web about the problem. I did try to build qt3dstudio but some of the dependencies caused my ubuntu desktop to stop working and I had to reinstall ubuntu.
QT modules in my .pro file:
QT += widgets qml quick gui 3dstudioruntime2
and when I hit build I get the following error:
Unknown module(s) in QT: 3dstudioruntime2

Qt 4.8.1 Postgres Psql driver not loaded (Windows7 64bit)

I cannot Debug with the old Qt 4.8.0 psql driver. And the new Qt 4.8.1 psql driver cannot be loaded..
[ListAvailableSQLDrivers : [0mPluginsPath() C:\QtSDK\Desktop\Qt\4.8.1\msvc2010\plugins
[ListAvailableSQLDrivers : [0mQSqlDatabase::drivers() QSQLITE
[ListAvailableSQLDrivers : [0mQSqlDatabase::drivers() QODBC3
[ListAvailableSQLDrivers : [0mQSqlDatabase::drivers() QODBC
I'm working with QtSDK 1.2 (Qt 4.8.1), Win7 64bit and PgAdmin 1.14.3
My QT c++ software can load the old psql driver from Qt 4.8.0:
C:\QtSDK\Desktop\Qt\4.8.1\msvc2010\plugins\sqldrivers,
qsqlpsql4.dll,
qsqlpsql4d.dll
I've tried to compile the psql driver from the Qt Sources. That worked partially. On my laptop, the compiled driver cannot be loaded, but on the laptops of my buddies this driver is working. We all have Win7 64bit. Any ideas how to track this down are welcomed.
thanx QtDeveloper
I'd recommend not to mix Qt-dlls of one computer with plugins built/installed on another.
Qt stores default paths of plugins in Qt-dlls and the paths provided during compilation/installation on different computers may differ.
Try to use procmon from sysinternals, and see during the start of the process which paths the app tries to open while seatching for the plugins.
Try to copy \plugins\sqldrivers* to <YourAppStartPath>\plugins\sqldrivers

Qt 5 ODBC driver issue

I am trying to use ODBC driver in one of my Qt5 project.
I compiled QODBC driver and copied the driver dlls to the Qt\Qt5.0.0\5.0.0\msvc2010\plugins\sqldrivers folder.
When I try the following code:
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
I get the following error:
QSqlDatabase: QODBC driver not loaded
QSqlDatabase: available drivers: QSQLITE QODBC QODBC3
Same error is encountered if I tried loading QODBC3.
Even though QODBC and QODBC3 drivers are present, Qt still could not load QODBC driver.
I am running Windows 7 (64 bit) PC.
Has anybody encountered such error? Any clues on what might be wrong ?
I found the issue was caused due to incorrect Visual studio versions used while compiling odbc sql driver.
I had both VS 2008 and VS 2010 in my computer. My Qt5.0 was using VS2010. But when I compiled the odbc sql driver, I had used VS2008. And that caused the problem.
Qt was able to detect the sql odbc driver but could not load it.
I solved this by recompiling the odbc driver using VS2010 and odbc driver works pefectly.
Here are the steps to compile and use sql odbc drivers in Qt 5.0
open qt command prompt:
this can be found in start menu under Qt
set vc++ environment variables:
To do this , cd into to the C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\ folder and run vcvarsall.bat
Important point to note is, compile the driver using the same version of Visual Studio thats used by Qt.
cd into \Qt5.0.0\5.0.0\Src\qtbase\src\plugins\sqldrivers\odbc source folder
qmake odbc.pro
nmake
If it runs correctly, the compiled qsqlodbc.dll and qsqlodbcd.dll
will be available in \Qt5.0.0\5.0.0\Src\qtbase\plugins\sqldrivers folder.
While deploying qt based application, qsqlodbc.dll (release version) need to be copied to sqldrivers folder.

Qt - incompatible .lib - LNK1112

I would like to write an application for Windows CE. I have already followed all the relevant steps, and started to write the application with Qt Creator.
However, when I started to build the code, there was the following error message:
QtCored4.lib(QtCored4.dll) : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'THUMB'
Maybe some more details:
I downloaded the library for Windows CE and I configured Qt-Opensource-Version 4.8.3 with following parameters:
configure -platform win32-msvc2008 -xplatform wince50standard-armv4i-msvc2008
All went well. Qt Creator did recognize the new version and added Windows CE as supported platform.
Now, I guess, that there will be the same problem with QtGuid4.lib. Does anybody know, where I get a compatible file?
The import library for a DLL - the .LIB file - contains machine code stubs that are linked into your program, that call through the import table for the EXE. Therefore, they have to match the processor family that you're compiling for.
You need to obtain the .lib file for the Windows CE ARMv4I build of QtCored4.dll. Try these instructions for building Qt for Windows CE.

Resources