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

Unresolved external symbol errors in basic project

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 864 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.
  • enjoysmathE Offline
    enjoysmathE Offline
    enjoysmath
    wrote on 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
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on 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

      enjoysmathE 2 Replies Last reply
      1
      • enjoysmathE Offline
        enjoysmathE Offline
        enjoysmath
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          Did you properly export/import the class ?

          Can you show the header you wrote ?

          enjoysmathE Offline
          enjoysmathE Offline
          enjoysmath
          wrote on last edited by enjoysmath
          #4
          This post is deleted!
          1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            Did you properly export/import the class ?

            Can you show the header you wrote ?

            enjoysmathE Offline
            enjoysmathE Offline
            enjoysmath
            wrote on 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
            • enjoysmathE Offline
              enjoysmathE Offline
              enjoysmath
              wrote on 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
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on 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

                • Login

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