Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QChart undefined reference to _imp__ZN8QtCharts
Forum Updated to NodeBB v4.3 + New Features

QChart undefined reference to _imp__ZN8QtCharts

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 4.9k 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.
  • M Offline
    M Offline
    Milori
    wrote on last edited by
    #1

    Hi,
    in mainwindow.h is:
    #include <QtSerialPort/QSerialPort>
    #include <QtCharts/QtCharts>
    private:
    Ui::MainWindow *ui;
    QSerialPort *serial;
    QChart *tempChart;

    and in mainwindow.cpp is:
    serial = new QSerialPort(this);
    tempChart = new QChart();

    Both new object *serial and *tempChart is brown highlighted and focused.
    Object serial works normally and object tempChart has error "undefined reference to `_imp___ZN8QtCharts6QChartC1EP13QGraphicsItem6QFlagsIN2Qt10WindowTypeEE'
    Where to look for a mistake

    mrjjM 1 Reply Last reply
    0
    • M Milori

      Hi,
      in mainwindow.h is:
      #include <QtSerialPort/QSerialPort>
      #include <QtCharts/QtCharts>
      private:
      Ui::MainWindow *ui;
      QSerialPort *serial;
      QChart *tempChart;

      and in mainwindow.cpp is:
      serial = new QSerialPort(this);
      tempChart = new QChart();

      Both new object *serial and *tempChart is brown highlighted and focused.
      Object serial works normally and object tempChart has error "undefined reference to `_imp___ZN8QtCharts6QChartC1EP13QGraphicsItem6QFlagsIN2Qt10WindowTypeEE'
      Where to look for a mistake

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Milori said in QChart undefined reference to _imp__ZN8QtCharts:

      QtCharts

      Hi
      Do you have
      QT += charts
      in the .pro file?

      1 Reply Last reply
      2
      • M Offline
        M Offline
        Milori
        wrote on last edited by
        #3

        No :), thanks.
        One Small question:
        is any link to pdf where is decribed this and others requires to correctly building QT projects?

        mrjjM 1 Reply Last reply
        0
        • M Milori

          No :), thanks.
          One Small question:
          is any link to pdf where is decribed this and others requires to correctly building QT projects?

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Milori
          For all classes, its listed in docs.
          http://doc.qt.io/qt-5/qtcharts-index.html
          says so down the page.

          Other example
          http://doc.qt.io/qt-5/qserialport.html
          alt text

          1 Reply Last reply
          3
          • M Offline
            M Offline
            Milori
            wrote on last edited by
            #5

            I apologize but i don't find asked pdf file on links.
            Where to study, for example, how different between import QT += serialport and QT +=core gui serialport is?

            jsulmJ 1 Reply Last reply
            0
            • M Milori

              I apologize but i don't find asked pdf file on links.
              Where to study, for example, how different between import QT += serialport and QT +=core gui serialport is?

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by jsulm
              #6

              @Milori Why do you need a PDF? The link posted by @mrjj points to official Qt documentation - there are no PDFs.
              "QT += serialport" - only adds support for serialport to your app (makes the serial port Qt classes available)
              "QT +=core gui serialport" - same as above but adds core and gui modules as well
              You only need to add modules you need, as @mrjj said you find which modules a class belongs to in its documentation.
              You should read this http://doc.qt.io/qt-5/qtmodules.html

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1

              • Login

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