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. Unresolved external symbol errors in basic project
Forum Update on Monday, May 27th 2025

Unresolved external symbol errors in basic project

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 878 Views
  • 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.
  • E Offline
    E Offline
    enjoysmath
    wrote on 23 Jul 2018, 06:44 last edited by enjoysmath
    #1

    mainwindow.obj:-1: error: LNK2019: unresolved external symbol "public: __cdecl Editor::Editor(class QString &,class QMainWindow *)" (??0Editor@@QEAA@AEAVQString@@PEAVQMainWindow@@@Z) referenced in function "private: void __cdecl MainWindow::on_actionNew_triggered(void)" (?on_actionNew_triggered@MainWindow@@AEAAXXZ)

    On a very basic app. I created an Editor class using the C++ header / source convention and am getting weird errors like this. No cyclically included headers.

    Is this a no brainer or do you need more info from me?

    I am getting these even though I write out the functions in the header file and remove the editor.cpp from the project. IT'S WEIRD.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 23 Jul 2018, 06:48 last edited by
      #2

      Hi,

      Did you properly export/import the class ?

      Can you show the header you wrote ?

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

      E 2 Replies Last reply 23 Jul 2018, 07:06
      1
      • E Offline
        E Offline
        enjoysmath
        wrote on 23 Jul 2018, 07:05 last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • S SGaist
          23 Jul 2018, 06:48

          Hi,

          Did you properly export/import the class ?

          Can you show the header you wrote ?

          E Offline
          E Offline
          enjoysmath
          wrote on 23 Jul 2018, 07:06 last edited by enjoysmath
          #4
          This post is deleted!
          1 Reply Last reply
          0
          • S SGaist
            23 Jul 2018, 06:48

            Hi,

            Did you properly export/import the class ?

            Can you show the header you wrote ?

            E Offline
            E Offline
            enjoysmath
            wrote on 23 Jul 2018, 07:14 last edited by
            #5

            @SGaist Still getting the error. Here is my editor.h:

            #ifndef EDITOR_H
            #define EDITOR_H
            
            #include <QMainWindow>
            #include <QGraphicsView>
            
            class Editor : public QGraphicsView
            {
            public:
                Editor(QString& name, QMainWindow* window);
                QString& tabName();
            
            private:
                QMainWindow* m_window;
                QString m_name;
            };
            
            #endif // EDITOR_H
            

            And my editor.cpp:

            #include "editor.h"
            
            Editor::Editor(QString& name, QMainWindow* window)
            {
                m_name = name;
                m_window = window;
            }
            
            QString& Editor::tabName() {
                return m_name;
            }
            
            1 Reply Last reply
            0
            • E Offline
              E Offline
              enjoysmath
              wrote on 23 Jul 2018, 07:30 last edited by
              #6

              Okay I fixed it by just creating a Qt Form Class with the new item wizard and renaming everything with QWidget to QGraphicsView, etc

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 23 Jul 2018, 21:31 last edited by
                #7

                Can you show your new version of your code ?

                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

                1/7

                23 Jul 2018, 06:44

                • Login

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