DB2 ODBC static build issue



  • I'm trying to build Qt 4.7.4 with msvc2010 statically with db2 odbc support.

    My configure arguments:

    C:\qt-src-4.7.4>configure -opensource -static -release -platform win32-msvc2010
    -qt-sql-db2 -qt-sql-odbc -I "C:\sqllib\include"
    

    Build without DB2 compiled fine, but after adding IBM include drivers there are some errors during configure process:

    c:\sqllib\include\sqlext.h(1995) : error C2146: syntax error: missing
     ";" before identifier "SQLProcedures"
    c:\sqllib\include\sqlext.h(1995) : error C4430: missing type specifier -
    int assumed. Note: C++ does not support default-int. 
    c:\sqllib\include\sqlext.h(1995) : error C2086: int SQL_API: redefenition
            c:\sqllib\include\sqlext.h(1744): see defenition of "SQL_API"
    c:\sqllib\include\sqlext.h(1996) : error C2065: SQLHSTMT: undeclared identifier
    c:\sqllib\include\sqlext.h(1996) : error C2146: syntax error: missing
     ")" before identifier "hstmt"
    c:\sqllib\include\sqlext.h(1996) : error C4430: missing type specifier -
    int assumed. Note: C++ does not support default-int. 
    c:\sqllib\include\sqlext.h(2005) : error C2059: syntax error: )
    c:\sqllib\include\sqlext.h(2009) : error C2146: syntax error: missing
     ";" before identifier "SQL_API"
    c:\sqllib\include\sqlext.h(2009) : error C4430: missing type specifier -
    int assumed. Note: C++ does not support default-int. 
    c:\sqllib\include\sqlext.h(2009) : error C2086: int SQLRETURN: redefenition
            c:\sqllib\include\sqlext.h(1744): see defenition of "SQLRETURN"
    c:\sqllib\include\sqlext.h(2009) : error C2146: syntax error: missing
     ";" before identifier "SQLSetPos"
    c:\sqllib\include\sqlext.h(2009) : error C4430: missing type specifier -
    int assumed. Note: C++ does not support default-int. 
    c:\sqllib\include\sqlext.h(2009) : error C2086: int SQL_API: redefenition
            c:\sqllib\include\sqlext.h(1744): see defenition of "SQL_API"
    c:\sqllib\include\sqlext.h(2009) : fatal error C1003: error count exceeds 100
    ; stopping compilation.
    qsqldriverplugin.cpp
    qsqlerror.cpp
    qsqlresult.cpp
    qsqlindex.cpp
    qsqlcachedresult.cpp
    NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\
    VC\BIN\amd64\cl.EXE" : return code "0x2"
    Stop.
    NMAKE : fatal error U1077: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\
    VC\BIN\amd64\nmake.exe" : return code "0x2"
    Stop.
    NMAKE : fatal error U1077: cd : return code "0x2"
    Stop.
    

    As soon as I've used only untouched source of IBM sql library and Qt I've no idea what can be wrong.

    Can someone clarify what should I do to eliminate these errors?


  • Qt Champions 2016

    Hi
    It seems like errors comes from the sqllib\include which is
    the IBM stuff ?

    For a error like
    error C2065: SQLHSTMT: undeclared identifier

    Where IS SQLHSTMT defined ?



  • @mrjj Here it is

    C:\sqllib\include\sqlcli.h:
      450  typedef  HENV              SQLHENV;
      451  typedef  HDBC              SQLHDBC;
      452: typedef  HSTMT             SQLHSTMT;
      453  typedef  HWND              SQLHWND;
      454  
      ...
      458  typedef  SQLHANDLE         SQLHENV;
      459  typedef  SQLHANDLE         SQLHDBC;
      460: typedef  SQLHANDLE         SQLHSTMT;
      461  #else
      462  
      ...
      465  typedef  SQLINTEGER        SQLHENV;
      466  typedef  SQLINTEGER        SQLHDBC;
      467: typedef  SQLINTEGER        SQLHSTMT;
      468  #endif
      469  #endif
    

    And that list is not exhaustive.

    But, to be honest, I don't think that there are errors in IBM supplied headers. I suppose, I messed somewhere.


  • Qt Champions 2016

    It could also be some define that alter what it sees
    but that error sounds like it simply not
    finding sqlcli.h

    Did u check it it finds that file ?
    I think its a path problem of sorts but cannot see what it
    should be since all are in same folder.

    Give it a day or two and see if other have tried this and know what could be wrong.



  • @mrjj well, thanks.
    I've tried to add #include <sqltypes.h> just in case, and voilĂ , now there are errors(C2065, C3861) inside Qt(drivers\odbc\qsql_odbc.cpp).

    Don't know if it's better, but still something.


  • Banned

    This post is deleted!

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.