Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Qt with eclipse C++
Forum Updated to NodeBB v4.3 + New Features

Qt with eclipse C++

Scheduled Pinned Locked Moved Solved C++ Gurus
6 Posts 4 Posters 2.5k Views 2 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.
  • G Offline
    G Offline
    GastonMelo
    wrote on last edited by
    #1

    Hi to all, im using C++ eclipse and make a simple GUI on Qt (Im using linux Tumbleweed). The GUI is a simple window with 2 buttons . I use the UIC file to generate a cpp file (header file) and then import that file into eclipse, also I added the Qt include folder into eclipse library path. Till here no problems, when I try to display the GUI on eclipse using this code inside main :

            Ui::MainWindow *dialog;
             QMainWindow w;
    	dialog = new Ui::MainWindow();
    	dialog->setupUi(&w);
    	w.show();
    

    this error is shown:

    undefined reference to `QMainWindow::QMainWindow(QWidget*, QFlagsQt::WindowType)'

    I have this includes :

    #include "QtWidgets/QApplication"
    #include "QtWidgets/QDialog"

    Im new in the Qt world. Also is possible to get a tutorial about eclipse C++ and Qt?
    Thanks in advance
    Gastón

    jsulmJ 1 Reply Last reply
    0
    • G Offline
      G Offline
      GastonMelo
      wrote on last edited by
      #4

      I add Qt5Core Qt5Gui and Qt5Widgets and it works.
      Gaston

      Pablo J. RoginaP 1 Reply Last reply
      1
      • G GastonMelo

        Hi to all, im using C++ eclipse and make a simple GUI on Qt (Im using linux Tumbleweed). The GUI is a simple window with 2 buttons . I use the UIC file to generate a cpp file (header file) and then import that file into eclipse, also I added the Qt include folder into eclipse library path. Till here no problems, when I try to display the GUI on eclipse using this code inside main :

                Ui::MainWindow *dialog;
                 QMainWindow w;
        	dialog = new Ui::MainWindow();
        	dialog->setupUi(&w);
        	w.show();
        

        this error is shown:

        undefined reference to `QMainWindow::QMainWindow(QWidget*, QFlagsQt::WindowType)'

        I have this includes :

        #include "QtWidgets/QApplication"
        #include "QtWidgets/QDialog"

        Im new in the Qt world. Also is possible to get a tutorial about eclipse C++ and Qt?
        Thanks in advance
        Gastón

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

        @GastonMelo said in Qt with eclipse C++:

        I added the Qt include folder into eclipse library path

        Do you mean to include path?
        The error message means that you're not linking against Qt libs.

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

        1 Reply Last reply
        2
        • G Offline
          G Offline
          GastonMelo
          wrote on last edited by
          #3

          hi jsulm,
          you are right, I add the Qt include folder to eclipse include path. Looking Qt library folder, do I need to add all those library to eclipse library?
          Thanks
          Gastón

          1 Reply Last reply
          0
          • G Offline
            G Offline
            GastonMelo
            wrote on last edited by
            #4

            I add Qt5Core Qt5Gui and Qt5Widgets and it works.
            Gaston

            Pablo J. RoginaP 1 Reply Last reply
            1
            • G GastonMelo

              I add Qt5Core Qt5Gui and Qt5Widgets and it works.
              Gaston

              Pablo J. RoginaP Offline
              Pablo J. RoginaP Offline
              Pablo J. Rogina
              wrote on last edited by
              #5

              @GastonMelo if your issue is solved please don't forget to mark your post as such

              Upvote the answer(s) that helped you solve the issue
              Use "Topic Tools" button to mark your post as Solved
              Add screenshots via postimage.org
              Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

              1 Reply Last reply
              0
              • Kent-DorfmanK Offline
                Kent-DorfmanK Offline
                Kent-Dorfman
                wrote on last edited by
                #6

                When last I looked at the Qt plugin for eclipse it was hopelessly broken. At the time eclipse had a lot of problems parsing the Qt framework include files and MOC system for code checking. Are you using the plugin, or just using eclipse as an editor?

                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