Results 1 to 8 of 8

Thread: can't build plugin QDB2 for IBM DB2

  1. #1
    Join Date
    May 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default can't build plugin QDB2 for IBM DB2

    Hi!
    I use Qt 4.6.2 Opensource on Windows XP.
    I tried hard to build plugin QDB2 for IBM DB2, but all my efforts end with multiple compiling errors like this:

    D:/Qt/2010.02.1/qt/src/plugins/sqldrivers/db2/../../../sql/drivers/db2/qsql_db2.cpp:64: In file included from ..\..\..\sql\drivers\db2\qsql_db2.cpp:64:
    c:\progra~1\IBM\SQLLIB\include/sqlcli1.h:966: error: declaration of C function 'SQLRETURN SQLColumnsW(SQLHSTMT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT)' conflicts with
    d:\qt\2010.02.1\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/sqlucode.h:31: error: previous declaration 'SQLRETURN SQLColumnsW(SQLHSTMT, SQLWCHAR*, SQLSMALLINT, SQLWCHAR*, SQLSMALLINT, SQLWCHAR*, SQLSMALLINT, SQLWCHAR*, SQLSMALLINT)' here

    Is there anybody to help me?

  2. #2
    Join Date
    May 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: can't build plugin QDB2 for IBM DB2

    Hi!
    I have understood that the remedy is to comment duplicate declarations. But the question arises - in what file I have to comment: in sqlcli1.h from IBM or in sqlucode.h from MinGW ?
    Thanks in advance.

  3. #3
    Join Date
    Feb 2009
    Location
    Bydgoszcz, Poland
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: can't build plugin QDB2 for IBM DB2

    Hi,

    I have another problem on compile QDB2 plugin ... so when I compiling I have error:

    Qt Code:
    1. mingw32-make.exe -f Makefile.Debug all
    2. mingw32-make.exe[1]: Entering directory `C:/Qt/2010.05-rc1/qt/src/plugins/sqldrivers/db2'
    3. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\include\QtSql" -I"..\..\..\..\include" -I"c:\Program" -I"Files\IBM\SQLLIB\include" -I"..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"c:\PROGRA~1\IBM\SQLLIB\INCLUDE" -I"c:\PROGRA~1\IBM\SQLLIB\LIB" -I"..\..\..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\qsql_db2.o ..\..\..\sql\drivers\db2\qsql_db2.cpp
    4. mingw32-make.exe[1]: Leaving directory `C:/Qt/2010.05-rc1/qt/src/plugins/sqldrivers/db2'
    To copy to clipboard, switch view to plain text mode 

    So you see, I compiling on Windows.

  4. #4
    Join Date
    Feb 2009
    Location
    Bydgoszcz, Poland
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: can't build plugin QDB2 for IBM DB2

    Add...

    I'm trying build plugin from the manual : http://qt.developpez.com/doc/4.7-sna...l-driver/#qdb2

    When entering command :
    Qt Code:
    1. qmake "INCLUDEPATH+=C:\Program Files\IBM\SQLLIB\include" "LIBS+=C:\Program Files\IBM\SQLLIB\lib\db2cli.lib"
    To copy to clipboard, switch view to plain text mode 

    Have 3 warring :
    Qt Code:
    1. WARNING: (internal):1: Unescaped backslashes are deprecated.
    To copy to clipboard, switch view to plain text mode 

    I have installed IBM DB2 v.9.2.

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: can't build plugin QDB2 for IBM DB2

    In your first post I can't see an error. And in the second it is just a warning, nothing more. You can avoid it by using
    Qt Code:
    1. qmake "INCLUDEPATH+=C:\\Program Files\\IBM\\SQLLIB\\include" "LIBS+=C:\\Program Files\\IBM\\SQLLIB\\lib\\db2cli.lib"
    To copy to clipboard, switch view to plain text mode 

  6. #6
    Join Date
    Feb 2009
    Location
    Bydgoszcz, Poland
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: can't build plugin QDB2 for IBM DB2

    Quote Originally Posted by Lykurg View Post
    In your first post I can't see an error.
    Yes it is true , this is corectly console output :
    Qt Code:
    1. C:\Qt\2010.04\qt\src\plugins\sqldrivers\db2>qmake "INCLUDEPATH+=C:\\Program File
    2. s\\IBM\\SQLLIB\\include" "LIBS+=C:\\Program Files\\IBM\\SQLLIB\\lib\\db2cli.lib"
    3.  
    4.  
    5. C:\Qt\2010.04\qt\src\plugins\sqldrivers\db2>mingw32-make.exe
    6. mingw32-make.exe -f Makefile.Debug all
    7. mingw32-make.exe[1]: Entering directory `C:/Qt/2010.04/qt/src/plugins/sqldrivers
    8. /db2'
    9. g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
    10. DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -
    11. DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\include\QtCore" -I"..\..\..\..\i
    12. nclude\QtSql" -I"..\..\..\..\include" -I"..\mysql" -I"c:\Program" -I"Files\IBM\S
    13. QLLIB\include" -I"..\..\..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"c:\P
    14. ROGRA~1\IBM\SQLLIB\INCLUDE" -I"c:\PROGRA~1\IBM\SQLLIB\LIB" -I"..\..\..\..\mkspec
    15. s\win32-g++" -o tmp\obj\debug_shared\qsql_db2.o ..\..\..\sql\drivers\db2\qsql_db
    16. 2.cpp
    17. ..\..\..\sql\drivers\db2\qsql_db2.cpp:62:1: warning: "UNICODE" redefined
    18. <command-line>: warning: this is the location of the previous definition
    19. In file included from ..\..\..\sql\drivers\db2\qsql_db2.cpp:64:
    20. c:\PROGRA~1\IBM\SQLLIB\INCLUDE/sqlcli1.h:977: error: declaration of C function '
    21. SQLRETURN SQLColumnsW(SQLHSTMT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQ
    22. LCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT)' conflicts with
    23. c:\qt\2010.04\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/sqlucode.h:
    24. 31: error: previous declaration 'SQLRETURN SQLColumnsW(SQLHSTMT, SQLWCHAR*, SQLS
    25. MALLINT, SQLWCHAR*, SQLSMALLINT, SQLWCHAR*, SQLSMALLINT, SQLWCHAR*, SQLSMALLINT)
    26. ' here
    27. c:\PROGRA~1\IBM\SQLLIB\INCLUDE/sqlcli1.h:986: error: declaration of C function '
    28. SQLRETURN SQLDataSourcesW(SQLHENV, SQLUSMALLINT, SQLCHAR*, SQLSMALLINT, SQLSMALL
    29. INT*, SQLCHAR*, SQLSMALLINT, SQLSMALLINT*)' conflicts with
    30. c:\qt\2010.04\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/sqlucode.h:
    31. 35: error: previous declaration 'SQLRETURN SQLDataSourcesW(SQLHENV, SQLUSMALLINT
    32. , SQLWCHAR*, SQLSMALLINT, SQLSMALLINT*, SQLWCHAR*, SQLSMALLINT, SQLSMALLINT*)' h
    33. ere
    34. c:\PROGRA~1\IBM\SQLLIB\INCLUDE/sqlcli1.h:1061: error: declaration of C function
    35. 'SQLRETURN SQLSpecialColumnsW(SQLHSTMT, SQLUSMALLINT, SQLCHAR*, SQLSMALLINT, SQL
    36. CHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLUSMALLINT, SQLUSMALLINT)' conflict
    37. s with
    38. c:\qt\2010.04\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/sqlucode.h:
    39. 75: error: previous declaration 'SQLRETURN SQLSpecialColumnsW(SQLHSTMT, SQLUSMAL
    40. LINT, SQLWCHAR*, SQLSMALLINT, SQLWCHAR*, SQLSMALLINT, SQLWCHAR*, SQLSMALLINT, SQ
    41. LUSMALLINT, SQLUSMALLINT)' here
    42. c:\PROGRA~1\IBM\SQLLIB\INCLUDE/sqlcli1.h:1072: error: declaration of C function
    43. 'SQLRETURN SQLStatisticsW(SQLHSTMT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT
    44. , SQLCHAR*, SQLSMALLINT, SQLUSMALLINT, SQLUSMALLINT)' conflicts with
    45. c:\qt\2010.04\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/sqlucode.h:
    46. 77: error: previous declaration 'SQLRETURN SQLStatisticsW(SQLHSTMT, SQLWCHAR*, S
    47. QLSMALLINT, SQLWCHAR*, SQLSMALLINT, SQLWCHAR*, SQLSMALLINT, SQLUSMALLINT, SQLUSM
    48. ALLINT)' here
    49. c:\PROGRA~1\IBM\SQLLIB\INCLUDE/sqlcli1.h:1082: error: declaration of C function
    50. 'SQLRETURN SQLTablesW(SQLHSTMT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQ
    51. LCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT)' conflicts with
    52. c:\qt\2010.04\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/sqlucode.h:
    53. 81: error: previous declaration 'SQLRETURN SQLTablesW(SQLHSTMT, SQLWCHAR*, SQLSM
    54. ALLINT, SQLWCHAR*, SQLSMALLINT, SQLWCHAR*, SQLSMALLINT, SQLWCHAR*, SQLSMALLINT)'
    55. here
    56. c:\PROGRA~1\IBM\SQLLIB\INCLUDE/sqlcli1.h:1271: error: declaration of C function
    57. 'SQLRETURN SQLColumnsW(SQLHSTMT, SQLWCHAR*, SQLSMALLINT, SQLWCHAR*, SQLSMALLINT,
    58. SQLWCHAR*, SQLSMALLINT, SQLWCHAR*, SQLSMALLINT)' conflicts with
    59. c:\PROGRA~1\IBM\SQLLIB\INCLUDE/sqlcli1.h:969: error: previous declaration 'SQLRE
    60. TURN SQLColumnsW(SQLHSTMT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR
    61. *, SQLSMALLINT, SQLCHAR*, SQLSMALLINT)' here
    62. c:\PROGRA~1\IBM\SQLLIB\INCLUDE/sqlcli1.h:1304: error: declaration of C function
    63. 'SQLRETURN SQLSpecialColumnsW(SQLHSTMT, SQLUSMALLINT, SQLWCHAR*, SQLSMALLINT, SQ
    64. LWCHAR*, SQLSMALLINT, SQLWCHAR*, SQLSMALLINT, SQLUSMALLINT, SQLUSMALLINT)' confl
    65. icts with
    66. c:\PROGRA~1\IBM\SQLLIB\INCLUDE/sqlcli1.h:1052: error: previous declaration 'SQLR
    67. ETURN SQLSpecialColumnsW(SQLHSTMT, SQLUSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR*
    68. , SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLUSMALLINT, SQLUSMALLINT)' here
    69. c:\PROGRA~1\IBM\SQLLIB\INCLUDE/sqlcli1.h:1315: error: declaration of C function
    70. 'SQLRETURN SQLStatisticsW(SQLHSTMT, SQLWCHAR*, SQLSMALLINT, SQLWCHAR*, SQLSMALLI
    71. NT, SQLWCHAR*, SQLSMALLINT, SQLUSMALLINT, SQLUSMALLINT)' conflicts with
    72. c:\PROGRA~1\IBM\SQLLIB\INCLUDE/sqlcli1.h:1063: error: previous declaration 'SQLR
    73. ETURN SQLStatisticsW(SQLHSTMT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQL
    74. CHAR*, SQLSMALLINT, SQLUSMALLINT, SQLUSMALLINT)' here
    75. c:\PROGRA~1\IBM\SQLLIB\INCLUDE/sqlcli1.h:1326: error: declaration of C function
    76. 'SQLRETURN SQLTablesW(SQLHSTMT, SQLWCHAR*, SQLSMALLINT, SQLWCHAR*, SQLSMALLINT,
    77. SQLWCHAR*, SQLSMALLINT, SQLWCHAR*, SQLSMALLINT)' conflicts with
    78. c:\PROGRA~1\IBM\SQLLIB\INCLUDE/sqlcli1.h:1074: error: previous declaration 'SQLR
    79. ETURN SQLTablesW(SQLHSTMT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR
    80. *, SQLSMALLINT, SQLCHAR*, SQLSMALLINT)' here
    81. c:\PROGRA~1\IBM\SQLLIB\INCLUDE/sqlcli1.h:1338: error: declaration of C function
    82. 'SQLRETURN SQLDataSourcesW(SQLHENV, SQLUSMALLINT, SQLWCHAR*, SQLSMALLINT, SQLSMA
    83. LLINT*, SQLWCHAR*, SQLSMALLINT, SQLSMALLINT*)' conflicts with
    84. c:\PROGRA~1\IBM\SQLLIB\INCLUDE/sqlcli1.h:979: error: previous declaration 'SQLRE
    85. TURN SQLDataSourcesW(SQLHENV, SQLUSMALLINT, SQLCHAR*, SQLSMALLINT, SQLSMALLINT*,
    86. SQLCHAR*, SQLSMALLINT, SQLSMALLINT*)' here
    87. mingw32-make.exe[1]: *** [tmp/obj/debug_shared/qsql_db2.o] Error 1
    88. mingw32-make.exe[1]: Leaving directory `C:/Qt/2010.04/qt/src/plugins/sqldrivers/
    89. db2'
    90. mingw32-make.exe: *** [debug-all] Error 2
    To copy to clipboard, switch view to plain text mode 
    In first I used command : mingw32-make.exe >> error.txt, and I thinking that in the "txt" file wrote all errors. As so you see This is no true.

    -------------------------------------

    Add...
    -------------
    When open in QTCreator I have many similary errors :
    Qt Code:
    1. c:\PROGRA~1\IBM\SQLLIB\INCLUDE/sqlcli1.h:977: error: declaration of C function 'SQLRETURN SQLColumnsW(SQLHSTMT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT, SQLCHAR*, SQLSMALLINT)' conflicts with
    To copy to clipboard, switch view to plain text mode 
    Last edited by bigkoma; 15th September 2010 at 08:31.

  7. #7
    Join Date
    Feb 2009
    Location
    Bydgoszcz, Poland
    Posts
    16
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: can't build plugin QDB2 for IBM DB2

    I resolved my problem:

    I musted edit file "mingw\include\qslucode.h" . In inner this file, I moved conflict lines to comment.

    and in file "db2.pro" , commented line :
    Qt Code:
    1. # win32:!contains( LIBS, .*db2.* ):LIBS *= -ldb2cli
    To copy to clipboard, switch view to plain text mode 

    And building

    Thanks for answer .

  8. #8
    Join Date
    May 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: can't build plugin QDB2 for IBM DB2

    Hi!
    I use Qt 4.7.3 Opensource on Windows 7.
    I had a similar problem as Vladimiron1 and bigkoma, but it solved the given method.

    Now I have another problem:

    Qt Code:
    1. C:\QtSDK2\QtSources\4.7.3\src\plugins\sqldrivers\db2>mingw32-make
    2. mingw32-make -f Makefile.Debug all
    3. mingw32-make[1]: Entering directory `C:/QtSDK2/QtSources/4.7.3/src/plugins/sqldrivers/db2'
    4. g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -mthreads -Wl -shared -Wl,--out-implib,c:\QtSDK2\QtSources\4.7.3\plugins\sqldrivers\libqsqldb2d4.a -o ..\..\..\..\plugins\sqldrivers\qsqldb2d4.dll tmp/obj/debug_shared/main.o tmp/obj/debug_shared/qsql_db2.o tmp/obj/de
    5. bug_shared/moc_qsql_db2.o -L"c:\QtSDK2\QtSources\4.7.3\lib" -L"c:\PROGRA~1\IBM\SQLLIB\LIB" -L"c:\QtSDK2\QtSources\4.7.3\lib" tmp\obj\debug_shared\qsqldb2d_resource_res.o C:\PROGRA~1\IBM\SQLLIB\lib\db2cli.lib -lQtSqld -lQtCored
    6. c:/qtsdk2/mingw/bin/../lib/gcc/mingw32/4.4.0/../../../../mingw32/bin/ld.exe: cannot find -lQtSqld
    7. collect2: ld returned 1 exit status
    8. mingw32-make[1]: *** [..\..\..\..\plugins\sqldrivers\qsqldb2d4.dll] Error 1
    9. mingw32-make[1]: Leaving directory `C:/QtSDK2/QtSources/4.7.3/src/plugins/sqldrivers/db2'
    10. mingw32-make: *** [debug-all] Error 2
    To copy to clipboard, switch view to plain text mode 

    I could not run configure.exe but apparently it is not needed.
    Qt Code:
    1. C:\QtSDK2\QtSources\4.7.3/src/corelib/io/qbuffer.cpp:43:33: error: private/qiodevice_p.h: No such file or directory
    2. C:\QtSDK2\QtSources\4.7.3/src/corelib/io/qbuffer.cpp:49: error: invalid use of incomplete type 'struct QIODevicePrivate'
    3. C:\QtSDK2\QtSources\4.7.3/include/QtCore/qiodevice.h:64: error: forward declaration of 'struct QIODevicePrivate'
    4. C:\QtSDK2\QtSources\4.7.3/src/corelib/io/qbuffer.cpp: In member function 'QBuffer* QBufferPrivate::q_func()':
    5. C:\QtSDK2\QtSources\4.7.3/src/corelib/io/qbuffer.cpp:50: error: 'q_ptr' was not declared in this scope
    6. C:\QtSDK2\QtSources\4.7.3/src/corelib/io/qbuffer.cpp: In member function 'const QBuffer* QBufferPrivate::q_func() const':
    7. C:\QtSDK2\QtSources\4.7.3/src/corelib/io/qbuffer.cpp:50: error: 'q_ptr' was not declared in this scope
    8. C:\QtSDK2\QtSources\4.7.3/src/corelib/io/qbuffer.cpp: In member function 'virtual qint64 QBufferPrivate::peek(char*, qint64)':
    9. C:\QtSDK2\QtSources\4.7.3/src/corelib/io/qbuffer.cpp:91: error: 'pos' was not declared in this scope
    10. C:\QtSDK2\QtSources\4.7.3/src/corelib/io/qbuffer.cpp: In member function 'virtual QByteArray QBufferPrivate::peek(qint64)':
    11. C:\QtSDK2\QtSources\4.7.3/src/corelib/io/qbuffer.cpp:98: error: 'pos' was not declared in this scope
    12. C:\QtSDK2\QtSources\4.7.3/src/corelib/io/qbuffer.cpp: In constructor 'QBuffer::QBuffer()':
    13. C:\QtSDK2\QtSources\4.7.3/src/corelib/io/qbuffer.cpp:158: error: no matching function for call to 'QIODevice::QIODevice(QBufferPrivate&)'
    14. C:\QtSDK2\QtSources\4.7.3/include/QtCore/qiodevice.h:169: note: candidates are: QIODevice::QIODevice(const QIODevice&)
    15. C:\QtSDK2\QtSources\4.7.3/include/QtCore/qiodevice.h:151: note: QIODevice::QIODevice(QIODevicePrivate&)
    16. C:\QtSDK2\QtSources\4.7.3/include/QtCore/qiodevice.h:87: note: QIODevice::QIODevice()
    17. C:\QtSDK2\QtSources\4.7.3/src/corelib/io/qbuffer.cpp: In constructor 'QBuffer::QBuffer(QByteArray*)':
    18. C:\QtSDK2\QtSources\4.7.3/src/corelib/io/qbuffer.cpp:165: error: no matching function for call to 'QIODevice::QIODevice(QBufferPrivate&)'
    19. C:\QtSDK2\QtSources\4.7.3/include/QtCore/qiodevice.h:169: note: candidates are: QIODevice::QIODevice(const QIODevice&)
    20. C:\QtSDK2\QtSources\4.7.3/include/QtCore/qiodevice.h:151: note: QIODevice::QIODevice(QIODevicePrivate&)
    21. C:\QtSDK2\QtSources\4.7.3/include/QtCore/qiodevice.h:87: note: QIODevice::QIODevice()
    22. mingw32-make: *** [qbuffer.o] Error 1
    23. Building qmake failed, return code 2
    To copy to clipboard, switch view to plain text mode 

    Thank in advance.

Similar Threads

  1. Where are libraries/headers for QDB2 plugin build?
    By Mookie in forum Qt Programming
    Replies: 0
    Last Post: 24th February 2010, 14:13
  2. Build Mysql plugin for Qt
    By Qt Coder in forum Qt Programming
    Replies: 9
    Last Post: 19th September 2009, 09:07
  3. Replies: 1
    Last Post: 14th July 2009, 09:28
  4. Custom Plugin problem to build
    By brevleq in forum Qt Programming
    Replies: 10
    Last Post: 21st December 2008, 17:41
  5. How build mysql plugin
    By MrShahi in forum Installation and Deployment
    Replies: 5
    Last Post: 8th June 2008, 00:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.