I’m on Ubuntu 32bits.
Qt 5.1.1
I installed with online installer in /opt/Qt (I created /opt/Qt before with writing perms for my user).
I installed from my user (not with root).
DB2 Client is installed on this machine and I can access my DB2 Database from DB2 CLI.
Db2 folder is:
/opt/ibm/db2/V10.5
I follow instructions on this page:
http://qt-project.org/doc/qt-4.8/sql-driver.html#qdb2
I do this command:
/opt/Qt/5.1.1/Src/qtbase/src/plugins/sqldrivers/db2$ qmake "INCLUDEPATH+=$DB2DIR/include" "LIBS+=-L$DB2DIR/lib32 -ldb2"
Note that I modify to point to lib32 folder because lib folder doesn’t exist. In this folder I have some .so files.
Also note that I had to go in folder “qtbase” instead of the one on the website because the path on the website doesn’t exist.
I have this message:
/opt/Qt/5.1.1/Src/qtbase/mkspecs/features/qt_functions.prf:184: resolve_depends(var, prefix) requires one or two arguments.
/opt/Qt/5.1.1/Src/qtbase/mkspecs/features/qt_functions.prf:250: resolve_depends(var, prefix) requires one or two arguments.
/opt/Qt/5.1.1/Src/qtbase/mkspecs/features/qt_functions.prf:250: resolve_depends(var, prefix) requires one or two arguments.
/opt/Qt/5.1.1/Src/qtbase/mkspecs/features/qt_functions.prf:250: resolve_depends(var, prefix) requires one or two arguments.
/opt/Qt/5.1.1/Src/qtbase/mkspecs/features/qt_functions.prf:250: resolve_depends(var, prefix) requires one or two arguments.
I can’t go further … I can’t make… I have errors too.
$ make
/usr/lib/i386-linux-gnu/qt5/bin/moc -DQ_USE_APPMENU -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I../../../../mkspecs/linux-g++ -I. -I/opt/ibm/db2/V10.5/include -I/usr/include/qt5 -I/usr/include/qt5/QtSql -I/usr/include/qt5/QtSql/5.0.1 -I/usr/include/qt5/QtSql/5.0.1/QtSql -I/usr/include/qt5/QtCore -I/usr/include/qt5/QtCore/5.0.1 -I/usr/include/qt5/QtCore/5.0.1/QtCore -I.moc/release-shared -I/usr/include -I/usr/include/c++/4.7 -I/usr/include/c++/4.7/backward -I/usr/include/i386-linux-gnu -I/usr/include/i386-linux-gnu/c++/4.7/. -I/usr/lib/gcc/i686-linux-gnu/4.7/include -I/usr/lib/gcc/i686-linux-gnu/4.7/include-fixed -I/usr/local/include main.cpp -o .moc/release-shared/main.moc
g++ -c -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -O2 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -O2 -Wall -W -D_REENTRANT -fPIC -DQ_USE_APPMENU -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I../../../../mkspecs/linux-g++ -I. -I/opt/ibm/db2/V10.5/include -I/usr/include/qt5 -I/usr/include/qt5/QtSql -I/usr/include/qt5/QtSql/5.0.1 -I/usr/include/qt5/QtSql/5.0.1/QtSql -I/usr/include/qt5/QtCore -I/usr/include/qt5/QtCore/5.0.1 -I/usr/include/qt5/QtCore/5.0.1/QtCore -I.moc/release-shared -o .obj/release-shared/main.o main.cpp
g++ -c -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -O2 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -O2 -Wall -W -D_REENTRANT -fPIC -DQ_USE_APPMENU -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -I../../../../mkspecs/linux-g++ -I. -I/opt/ibm/db2/V10.5/include -I/usr/include/qt5 -I/usr/include/qt5/QtSql -I/usr/include/qt5/QtSql/5.0.1 -I/usr/include/qt5/QtSql/5.0.1/QtSql -I/usr/include/qt5/QtCore -I/usr/include/qt5/QtCore/5.0.1 -I/usr/include/qt5/QtCore/5.0.1/QtCore -I.moc/release-shared -o .obj/release-shared/qsql_db2.o ../../../sql/drivers/db2/qsql_db2.cpp
../../../sql/drivers/db2/qsql_db2.cpp:43:40: fatal error: QtSql/private/qsqldriver_p.h: No such file or directory
compilation terminated.
make: *** [.obj/release-shared/qsql_db2.o] Error 1
I would like to be able to access my DB2 remote database from my Qt App… How ?
↧