Unresolved externals in QtSql.lib (VS 2010 x64 Build)



  • Hello,

    I am running on Windows 7 Ultimate N x64 and I downloaded version 4.7.0 of the SDK this afternoon and built my x64 libraries via a Visual Studio x64 Command Window using this:

    -debug-and-release -static -platform win32-msvc2010 -nomake examples -nomake demos -no-qt3support -no-webkit -no-phonon -qt-style-windowsvista -no-style-cde -no-style-cleanlooks -no-style-plastique -no-style-s60 -no-style-motif -no-style-windowsmobile -no-style-windowsce -no-sql-sqlite -qt-sql-odbc -no-script -no-scripttools -ltcg -no-opengl -no-openvg -graphicssystem raster -no-libmng -no-libtiff -no-dsp -no-vcproj -incredibuild-xge -arch windows -opensource -saveconfig x64

    I have since moved an application from Visual Studio 2008 (Qt 4.6.2) and built on Vista x64 to this platform but I now get the following errors:

    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLGetDiagRecW
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLGetData
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLDescribeColW
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLColAttributeW
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLGetInfoW
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLSetConnectAttrW
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLFreeHandle
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLAllocHandle
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLSetStmtAttrW
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLExecDirectW
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLGetStmtAttrW
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLNumResultCols
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLFetchScroll
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLFetch
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLRowCount
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLPrepareW
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLCloseCursor
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLBindParameter
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLExecute
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLMoreResults
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLSetEnvAttr
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLDriverConnectW
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLDisconnect
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLGetFunctions
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLEndTran
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLTablesW
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLPrimaryKeysW
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLSpecialColumnsW
    1>QtSql.lib(qsql_odbc.obj) : error LNK2001: unresolved external symbol SQLColumnsW

    The QtSql.lib file is in the search path along with the others that were built, so I don't see what I am missing. If I reboot my machine from the other disk back in to Windows Vista I know the project will build and run.

    I have searched for this error but I get nothing so it kind of points the finger at me but after much faffing around I am no wiser so I would really appreciate your comments on this please.

    --
    Bill



  • Try running depends.exe on the QtSql.dll file. It looks like some dependency (maybe an ODBC library) is not being found?



  • Why don't you use Qt 4.7.2?



  • Thank you for the replies, so to update I've just recompiled Qt from the 4.7.2 sources and I am still getting these unresolved errors. I also built Qt from 4.7.2 using the Intel C++ Composer XE 2011 (v12.0.1024.2010) (as this is our main compiler tool) and I still end up with the same results.

    Using Depends on the (Intel) built .libs results in an error:
    QTSQL.LIB No DOS or PE signature found. This file is not a valid 32-bit or 64-bit Windows module.

    However, the same error is generated regardless of what .lib file I open and I only get unresolved errors for this library. I don't know how to proceed I am at a complete loss. Can anyone shed some light on this issue please I'm getting desperate.

    --
    Bill



  • The error message looks like there are some libraries for ODBC are missing.



  • [quote author="Volker" date="1301776666"]The error message looks like there are some libraries for ODBC are missing.[/quote]

    Hi Volker, I agree and is semi-evident from the output. I have since installed Visual Studio 2008, and the Intel Compiler v11.1.850.2008 on the Windows 7 Machine and copied over the original libraries again without success. I'm now resigned to making my required changes under Vista and VS 2008.

    Since we cannot point the finger in any one direction, be that Windows 7, Nokia, Visual Studio, Intel or us we have decided to drop Qt. There has been many man hours wasted on this on what was assumed would be a relatively pain free upgrade, and we have more to do with our time than waste it.

    For those that replied "thank you".

    --
    Bill



  • Too bad you feel you have to throw away many man hours just because you cannot build one library, I'm guessing that's more of a bad project management decision than a bad technical one.

    I had a similar thing with my RPC library that uses std::strings encoded in UTF8, so jumping back and forth between QStrings and std::strings was a nightmare, all because we do remoting to an application server that runs database tasks.

    Instead of throwing away many man hours because of the overhead of transforming strings back and forth, we opted for using another database library that uses std::strings in UTF8 as well and that way we needed to do less QString - std::string conversions.

    The library is called POCO C++, check it out, and use it instead of QtSql, that way you can keep the cool QtGui lib and not throw away all of your code, and just replace the one library that's giving you headaches.

    EDIT: and btw, if your time is so precious and expensive that you can't waste it fixing issues, you should instead buy some Qt licenses and get commercial support, that way you get a warranty that your product will work the way you expect, and if it doesn't you get some of the best Qt programmers to help you get it running as expected.



  • As you mention x64 platform, just a wild guess that it may not have the correct platform version of the odbc libs available.



  • For what it's worth I agree with Raul, a serious waste of time, effort and no doubt money. If it's of any help make sure you link with the odbc libraries found in your Windows SDK. This should of course happen by default assuming your SDK's library path in referenced in your environment.

    --
    Regards,

    William


Log in to reply
 

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