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. cannot find qsqlodbc4 and QtCore
Forum Updated to NodeBB v4.3 + New Features

cannot find qsqlodbc4 and QtCore

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
4 Posts 2 Posters 1.3k 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.
  • V Offline
    V Offline
    valeriy
    wrote on last edited by valeriy
    #1

    I transfer project from version 4 to 5. my experience with Qt is very small.
    when I build the project, i get errors:

    cannot find -lC:\Qt\5.5\mingw492_32/plugins/sqldrivers/qsqlodbc4
    cannot find -lc:/Qt/4.6.3/lib/QtCore
    error: ld returned 1 exit status

    TEMPLATE = app
    TARGET = monitor
    DESTDIR = ./Debug
    QT += network sql
    CONFIG += debug
    DEFINES += QT_XML_LIB QT_SQL_LIB QT_NETWORK_LIB
    INCLUDEPATH += ./GeneratedFiles \
        ./GeneratedFiles/Debug \
        . \
        ./release \
        ./debug \
        $(QTDIR)/mkspecs/win32-msvc2008
    LIBS += -L"$(QTDIR)/plugins/sqldrivers" \
        -l$(QTDIR)/plugins/sqldrivers/qsqlodbc4 \
        -lgdi32 \
        -lcomdlg32 \
        -loleaut32 \
        -limm32 \
        -lwinmm \
        -lwinspool \
        -lws2_32 \
        -lole32 \
        -luser32 \
        -ladvapi32 \
        -lmsimg32 \
        -lshell32 \
        -lc:/Qt/4.6.3/lib/QtCore \
        -lkernel32 \
        -luuid
    
    DEPENDPATH += .
    MOC_DIR += ./GeneratedFiles/debug
    OBJECTS_DIR += debug
    UI_DIR += ./GeneratedFiles
    RCC_DIR += ./GeneratedFiles
    
    #Include file(s)
    include(monitor.pri)
    
    #Windows resource file
    win32:RC_FILE = monitor.rc
    
    

    I tried correcting -lc: /Qt/4.6.3/lib/QtCore \ on -lc: /Qt/5.5/mingw492_32/lib/Qt5Core
    qsqlodbc4 on qsqlodbc.dll
    it exists in a folder C:\Qt\5.5\mingw492_32\plugins\sqldrivers
    pls help :)

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

      Hi and welcome to devnet,

      Some things that are looking suspicious in your .pro file:

      1. Why do you have the mkspecs path in your INCLUDEPATH ?
      2. Why do you have the path the the sqldrivers in your linker path list ?
      3. Why are you linking directly to QtCore and qsqlodbc4 ?
      4. Why are there so many Windows libraries in your LIBS list ? Unless you are using some Windows API directly all the libraries needed will get linked properly based on the Qt modules you are using.
      5. Why QT_XML_LIB QT_SQL_LIB QT_NETWORK_LIB in DEFINES ?
      6. Based on QT_XML_LIB, you are missing QT += xml

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      V 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Some things that are looking suspicious in your .pro file:

        1. Why do you have the mkspecs path in your INCLUDEPATH ?
        2. Why do you have the path the the sqldrivers in your linker path list ?
        3. Why are you linking directly to QtCore and qsqlodbc4 ?
        4. Why are there so many Windows libraries in your LIBS list ? Unless you are using some Windows API directly all the libraries needed will get linked properly based on the Qt modules you are using.
        5. Why QT_XML_LIB QT_SQL_LIB QT_NETWORK_LIB in DEFINES ?
        6. Based on QT_XML_LIB, you are missing QT += xml
        V Offline
        V Offline
        valeriy
        wrote on last edited by valeriy
        #3

        @SGaist said:

        Hi and welcome to devnet,

        Some things that are looking suspicious in your .pro file:

        1. Why do you have the mkspecs path in your INCLUDEPATH ?
        2. Why do you have the path the the sqldrivers in your linker path list ?
        3. Why are you linking directly to QtCore and qsqlodbc4 ?
        4. Why are there so many Windows libraries in your LIBS list ? Unless you are using some Windows API directly all the libraries needed will get linked properly based on the Qt modules you are using.
        5. Why QT_XML_LIB QT_SQL_LIB QT_NETWORK_LIB in DEFINES ?
        6. Based on QT_XML_LIB, you are missing QT += xml

        I did not write it because I do not know
        but i fixed .pro file:

        QT       += core gui network sql multimedia xml
        
        greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
        
        TARGET = monitor
        TEMPLATE = app
        CONFIG += debug
        DEFINES += QT_XML_LIB QT_SQL_LIB QT_NETWORK_LIB
        INCLUDEPATH += ./GeneratedFiles \
            ./GeneratedFiles/Debug \
            . \
            ./release \
            ./debug
        
        DEPENDPATH += .
        MOC_DIR += ./GeneratedFiles/debug
        OBJECTS_DIR += debug
        UI_DIR += ./GeneratedFiles
        RCC_DIR += ./GeneratedFiles
        
        #Include file(s)
        include(monitor.pri)
        
        #Windows resource file
        win32:RC_FILE = monitor.rc
        
        

        what do you say?

        and now I have new errors, i can create a new topic or add to this?)
        Qt5 minGW
        undefined reference to more_counter::more_counter(QDialog*)
        undefined reference to more_counter::setpParent(IPWindow*)
        undefined reference to more_counter::setName(QString)

        class that declares some private fields:

        more_counter* moredlg;
        etc.
        

        error occurs in lines:

               moredlg = new more_counter();
               moredlg->setpParent(this);
               moredlg->setName(master->deviceDescr.name);
               moredlg->iShow();
        

        class more_counter announced:
        ifdef / def / endif - exist

        class more_counter : public QDialog
        {
            Q_OBJECT
         
        public:
            more_counter(QDialog *parent = 0);
            ~more_counter();
         
        public:
            void iShow();
            void setpParent(IPWindow* prt);
            void setName(QString name);
         
        private:
            Ui::more_counter ui;
            
            IPWindow* parent;
            more_count* list;
            
            void GetData();
            void keyPressEvent(QKeyEvent *event);
                
        private slots:
            void on_pb_close_clicked();
            
        };
        In another header is:
        

        namespace Ui {
        class more_counter: public Ui_more_counter {};
        }
        I tried lot of options, but there is no result :(

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

          The DEFINES still don't make sense and unless you are generating headers as part of your build (which doesn't seem to be the case) There's no need of the paths added to INCLUDEPATH.

          The errors you are getting indicates that the class is not built.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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