Location of Qt 5.4 source code
-
After nmake, I believe you need nmake install
-
The documentation has been updated for the next release
-
Thanks for updating the documentation
Okay, i did mingw32-make install
So it copied qsqloci.dll and qsqlocid.dll to the sqldrivers and Qt5Sql_QOCIDriverPlugin.cmake (and i don't know what it is)
For being sure, i copied these .dll and libqsqlocid.a, libqsqloci.a to every folder which i thought could need them. When making a new project, qDebug()<<QSqlDatabase::drivers(); prints:
@("QSQLITE", "QMYSQL", "QMYSQL3", "QOCI", "QOCI8", "QODBC", "QODBC3", "QPSQL", "QPSQL7")@But after i had tried to connect to my database, it failed and lastError().text() returned the next: "Driver not loaded Driver not loaded"
My code of connection:
@qDebug()<<QSqlDatabase::drivers();
QSqlDatabase db;
db.addDatabase("QOCI");
db.setHostName("192.168.2.");
db.setDatabaseName("orcl.slesherdb.");
db.setUserName("");
db.setPassword("");
bool ok = db.open();
qDebug()<<db.lastError().text();@My listing of cmd after mingw32-make install
@D:\apps\QT5_4\5.4\Src\qtbase\src\plugins\sqldrivers\oci>mingw32-make install
mingw32-make -f Makefile.Release install
mingw32-make[1]: Entering directory 'D:/apps/QT5_4/5.4/Src/qtbase/src/plugins/sq
ldrivers/oci'
copy /y "........\plugins\sqldrivers\qsqloci.dll" "D:\apps\QT5_4\5.4\mingw491
_32\plugins\sqldrivers\qsqloci.dll"
1 file(s) copied.
copy /y D:\apps\QT5_4\5.4\Src\qtbase\lib\cmake\Qt5Sql\Qt5Sql_QOCIDriverPlugin.cm
ake D:\apps\QT5_4\5.4\mingw491_32\lib\cmake\Qt5Sql
1 file(s) copied.
mingw32-make[1]: Leaving directory 'D:/apps/QT5_4/5.4/Src/qtbase/src/plugins/sql
drivers/oci'
mingw32-make -f Makefile.Debug install
mingw32-make[1]: Entering directory 'D:/apps/QT5_4/5.4/Src/qtbase/src/plugins/sq
ldrivers/oci'
copy /y "........\plugins\sqldrivers\qsqlocid.dll" "D:\apps\QT5_4\5.4\mingw49
1_32\plugins\sqldrivers\qsqlocid.dll"
1 file(s) copied.
copy /y D:\apps\QT5_4\5.4\Src\qtbase\lib\cmake\Qt5Sql\Qt5Sql_QOCIDriverPlugin.cm
ake D:\apps\QT5_4\5.4\mingw491_32\lib\cmake\Qt5Sql
1 file(s) copied.
mingw32-make[1]: Leaving directory 'D:/apps/QT5_4/5.4/Src/qtbase/src/plugins/sql
drivers/oci'@ -
I'd say the obi dll(s) can't be found by your application. Go to the run part of the Project panel and update the PATH environment variable by adding "D:\OClient\product\11.2.0\client_1\oci\lib\msvc" if it contains the dlls or the corresponding folder in there
-
Unfortunately, it has already been added.
And it has also been added Windows folder, System32 folder, and the bin folders of Oracle client and Oracle server, where oci.dll is placed -
I did as you wrote here:http://qt-project.org/forums/viewthread/21546
So I added new environmental variable QT_DEBUG_PLUGINS = 1
There are lots of things I can't understand
So here is listing of application output:@QFactoryLoader::QFactoryLoader() looking at "D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers/libqsqloci.a"
"Plugin verification data mismatch in 'D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers/libqsqloci.a'"
not a plugin
QFactoryLoader::QFactoryLoader() looking at "D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers/libqsqlocid.a"
"Plugin verification data mismatch in 'D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers/libqsqlocid.a'"
not a plugin
QFactoryLoader::QFactoryLoader() looking at "D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers/oci.dll"
"Plugin verification data mismatch in 'D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers/oci.dll'"
not a plugin
QFactoryLoader::QFactoryLoader() looking at "D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers/qsqloci.dll"
Found metadata in lib D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers/qsqloci.dll, metadata=
{
"IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
"MetaData": {
"Keys": [
"QOCI8",
"QOCI"
]
},
"className": "QOCIDriverPlugin",
"debug": false,
"version": 328704
}"The plugin 'D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers/qsqloci.dll' uses incompatible Qt library. (Cannot mix debug and release libraries.)"
not a plugin
QFactoryLoader::QFactoryLoader() looking at "D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers/qsqlocid.dll"
Found metadata in lib D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers/qsqlocid.dll, metadata=
{
"IID": "org.qt-project.Qt.QSqlDriverFactoryInterface",
"MetaData": {
"Keys": [
"QOCI8",
"QOCI"
]
},
"className": "QOCIDriverPlugin",
"debug": true,
"version": 328704
}Got keys from plugin meta data ("QOCI8", "QOCI")
Got keys from plugin meta data ("windows")
QFactoryLoader::QFactoryLoader() checking directory path "D:/apps/QT5_4/Tools/QtCreator/bin/build-sql-Desktop_Qt_5_4_0_MinGW_32bit-Debug/debug/platforms" ...
loaded library "D:/apps/QT5_4/5.4/mingw491_32/plugins/platforms/qwindowsd.dll"
QFactoryLoader::QFactoryLoader() checking directory path "D:/apps/QT5_4/5.4/mingw491_32/plugins/platformthemes" ...
QFactoryLoader::QFactoryLoader() checking directory path "D:/apps/QT5_4/Tools/QtCreator/bin/build-sql-Desktop_Qt_5_4_0_MinGW_32bit-Debug/debug/platformthemes" ...
QFactoryLoader::QFactoryLoader() checking directory path "D:/apps/QT5_4/5.4/mingw491_32/plugins/platforminputcontexts" ...
QFactoryLoader::QFactoryLoader() checking directory path "D:/apps/QT5_4/Tools/QtCreator/bin/build-sql-Desktop_Qt_5_4_0_MinGW_32bit-Debug/debug/platforminputcontexts" ...
QFactoryLoader::QFactoryLoader() checking directory path "D:/apps/QT5_4/5.4/mingw491_32/plugins/generic" ...
QFactoryLoader::QFactoryLoader() checking directory path "D:/apps/QT5_4/Tools/QtCreator/bin/build-sql-Desktop_Qt_5_4_0_MinGW_32bit-Debug/debug/generic" ...
QFactoryLoader::QFactoryLoader() checking directory path "D:/apps/QT5_4/5.4/mingw491_32/plugins/styles" ...
QFactoryLoader::QFactoryLoader() checking directory path "D:/apps/QT5_4/Tools/QtCreator/bin/build-sql-Desktop_Qt_5_4_0_MinGW_32bit-Debug/debug/styles" ...
QFactoryLoader::QFactoryLoader() checking directory path "D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers" ...
QFactoryLoader::QFactoryLoader() looking at "D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers/libqsqloci.a"
"Plugin verification data mismatch in 'D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers/libqsqloci.a'"
not a plugin
QFactoryLoader::QFactoryLoader() looking at "D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers/libqsqlocid.a"
"Plugin verification data mismatch in 'D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers/libqsqlocid.a'"
not a plugin
QFactoryLoader::QFactoryLoader() looking at "D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers/oci.dll"
"Plugin verification data mismatch in 'D:/apps/QT5_4/5.4/mingw491_32/plugins/sqldrivers/oci.dll'"
not a plugin@
-
Did you check the environment variable value in the run part ? Depending on when you did your modification, it might be not up to date
-
[quote author="SGaist" date="1424219154"]Did you check the environment variable value in the run part ? Depending on when you did your modification, it might be not up to date[/quote]
I'm not sure if I understood you. I changed only PATH variable, the other ones are by default.
And I am confused why QT_DEBUG_PLUGINS tells me that some of .dlls are not plugins, or uses incompatible Qt library. (Cannot mix debug and release libraries.) -
Some people change their system PATH rather than just in Qt Creator, that's why I asked the double check of PATH.
IIRC both debug and release dlls are stored in the same folder so Qt will check them all hence the incompatibility error message.
-
The problem is solved.
I have changed the part of code of connection:
@QSqlDatabase db;
db.addDatabase("QOCI");@instead of
@QSqlDatabase db = QSqlDatabase::addDatabase("QOCI");@
When I guessed to change back, everything was ok.
Thanks a lot to all!