Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. DB2 ODBC static build issue
Forum Updated to NodeBB v4.3 + New Features

DB2 ODBC static build issue

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
msvc2010odbcdb2nmakeqt4.7.4
6 Posts 3 Posters 2.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    win_
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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 ?

      W 1 Reply Last reply
      0
      • mrjjM mrjj

        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 ?

        W Offline
        W Offline
        win_
        wrote on last edited by
        #3

        @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.

        1 Reply Last reply
        0
        • mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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.

          W 1 Reply Last reply
          0
          • mrjjM mrjj

            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.

            W Offline
            W Offline
            win_
            wrote on last edited by
            #5

            @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.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              stephen25
              Banned
              wrote on last edited by tekojo
              #6
              This post is deleted!
              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved