Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
None
-
5.10
-
None
-
*Distro*
Archlinux 64
*GCC*
Version 7.2.0-3
*DB2 Express-C Client Libraries Linux x64*
Version 11.1
*Configuration*
~/Git/qt5/configure -prefix /opt/Qt5.10 -developer-build -opensource -confirm-license -nomake examples -nomake tests -L /home/.../Git/qt5/clidriver/lib -I /home/..../Git/qt5/clidriver/include*Distro* Archlinux 64 *GCC* Version 7.2.0-3 *DB2 Express-C Client Libraries Linux x64* Version 11.1 *Configuration* ~/Git/qt5/configure -prefix /opt/Qt5.10 -developer-build -opensource -confirm-license -nomake examples -nomake tests -L /home/.../Git/qt5/clidriver/lib -I /home/..../Git/qt5/clidriver/include
Description
When attempting to compile the QDB2 driver on Linux 64-bit, g++ throws an error as it cannot convert from the int of Qt::Handle(int) to a 64-bit void*. As I understand it, this bug was introduced in 5.7
The first reference to this I found is this Stackoverflow.
The second is from Fossies
And finally more an an explanation from Milania's Blog
Attempted to compile with the -m64 flag enabled, but it had no effect.
g++ -c -pipe -m64 -g -Og -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow -Werror -Wno-error=cpp -Wno-error=deprecated-decla rations -Wno-error=strict-overflow -Wno-error=implicit-fallthrough -D_REENTRANT -fPIC -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQ T_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB ... ... /home/.../Git/qt5/qtbase/src/plugins/sqldrivers/db2/qsql_db2.cpp: In constructor 'QDB2Driver::QDB2Driver(Qt::HANDLE, Qt::HANDLE, QObject*)': /home/.../Git/qt5/qtbase/src/plugins/sqldrivers/db2/qsql_db2.cpp:1199:46: error: cast from 'Qt::HANDLE {aka void*}' to 'SQLHANDLE {aka int}' loses precision [-fpermissive] d->hEnv = reinterpret_cast<SQLHANDLE>(env); ^ /home/.../Git/qt5/qtbase/src/plugins/sqldrivers/db2/qsql_db2.cpp:1200:46: error: cast from 'Qt::HANDLE {aka void*}' to 'SQLHANDLE {aka int}' loses precision [-fpermissive] d->hDbc = reinterpret_cast<SQLHANDLE>(con); ^
Reverting back to the change linked in Fossies allows the plugin to compile and load.
Edit 1: Fixed stackoverflow link
Attachments
Issue Links
- duplicates
-
QTBUG-53864 The DB2 sql plugin can not be compiled on 64Bit Linux
- Closed