Linking error



  • Hey, im having a nightmare, im learning to use QT and i've to use mysql in my application, so i got the mysql c++ connector following this guide https://dev.mysql.com/doc/connector-cpp/en/connector-cpp-apps-windows-visual-studio.html, so i realized that QT has one already, then i had to remove it, and now i get tons of errors compiling :(

    theres some of these annoying errors

    1>FacNo.obj : error LNK2001: unresolved external symbol "protected: virtual int __cdecl QTableView::horizontalOffset(void)const " (?horizontalOffset@QTableView@@MEBAHXZ)
    1>FacNo.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QTableView::horizontalScrollbarAction(int)" (?horizontalScrollbarAction@QTableView@@MEAAXH@Z)
    1>FacNo.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QAbstractItemView::horizontalScrollbarValueChanged(int)" (?horizontalScrollbarValueChanged@QAbstractItemView@@MEAAXH@Z)
    1>FacNo.obj : error LNK2001: unresolved external symbol "public: virtual class QModelIndex __cdecl QTableView::indexAt(class QPoint const &)const " (?indexAt@QTableView@@UEBA?AVQModelIndex@@AEBVQPoint@@@Z)
    1>FacNo.obj : error LNK2001: unresolved external symbol "protected: virtual void __cdecl QAbstractItemView::inputMethodEvent(class QInputMethodEvent *)" (?inputMethodEvent@QAbstractItemView@@MEAAXPEAVQInputMethodEvent@@@Z)

    I think that its something about the linker, but i dont know how to fix it :( thank you in advance, and sorry for my mediocre english


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What did you remove exactly ?



  • libmysql.lib from linker->general
    mysqlcppconn-static.lib and libmysql.lib from linker->Additional Dependences
    CPPCONN_PUBLIC_FUNC= from C++->Preprocessor Definitions


  • Lifetime Qt Champion

    Strange, it looks completely unrelated to your problem.

    Did you do a full rebuild of the project ?

    Am I right that are you using Visual Studio to build your app rather than Qt Creator ?



  • Yes i did a full rebuild and yes, im using VS :)


  • Lifetime Qt Champion

    Did you create the project directly in VS or do you have a .pro file ?



  • It was created directly in VS and everything worked fine til i removed the C++ connector


  • Lifetime Qt Champion

    Then check whether there's not the widget module missing in your linker flags.



  • Ok, ill try to get some info because i have no idea how to do that


Log in to reply
 

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