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. Where is the error here?
Qt 6.11 is out! See what's new in the release blog

Where is the error here?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 4 Posters 2.4k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1
    void PagesTextEdit::WebBox() {
    
    QMainWindow *WebBoxWindow = new QMainWindow;
    QToolBar *WebBoxToolBar = new QToolBar;
    WebBoxToolBar->setStyleSheet("QToolBar {background: rgb(255, 255, 255) }");
    WebBoxToolBar->setFloatable(false);
    
    
    QAction *ActBack = new QAction;
    ActBack->setIcon(QIcon(":/ic_arrow_back.png"));
    WebBoxToolBar->addAction(ActBack);
    
    
    QAction *ActForward = new QAction;
    ActForward->setIcon(QIcon(":/ic_arrow_forward_black_24dp.png"));
    WebBoxToolBar->addAction(ActForward);
    
    
    WebBoxToolBar->show();
       QWebEngineView *view = new QWebEngineView(WebBoxWindow);
        view->setWindowTitle("Nachschlagen im Web mit Google");
    
    
        view->setWindowIcon(QIcon(":/ic_web_black_24dp_1x.png"));
        view->load(QUrl("http://www.google.de/"));
    
    
    
    
    WebBoxWindow->setCentralWidget(view);
    view->show();
    WebBoxWindow->show();
    WebBoxWindow->addToolBar(WebBoxToolBar);
    WebBoxWindow->setWindowTitle("Nachschlagen im Web");
    
    
    connect(ActBack, &QAction::triggered, this, &PagesTextEdit::ActBackF);
    connect(ActForward, &QAction::triggered, this, &PagesTextEdit::ActForwardF);
    
    
     }
    
    
    Where is the error here?
    

    pagestextedit.obj:-1: Fehler: LNK2019: unresolved external symbol "public: void __cdecl PagesTextEdit::ActBackF(void)" (?ActBackF@PagesTextEdit@@QEAAXXZ) referenced in function "public: void __cdecl PagesTextEdit::WebBox(void)" (?WebBox@PagesTextEdit@@QEAAXXZ)

    kshegunovK 1 Reply Last reply
    0
    • C Offline
      C Offline
      Carmoneer
      wrote on last edited by
      #2

      The error is stating that you've declared your function 'ActBackF' but haven't defined it. Check your .cpp file and see if you forgot to use the scope resolution operator in it's definition. Just one idea.

      1 Reply Last reply
      1
      • ? A Former User
        void PagesTextEdit::WebBox() {
        
        QMainWindow *WebBoxWindow = new QMainWindow;
        QToolBar *WebBoxToolBar = new QToolBar;
        WebBoxToolBar->setStyleSheet("QToolBar {background: rgb(255, 255, 255) }");
        WebBoxToolBar->setFloatable(false);
        
        
        QAction *ActBack = new QAction;
        ActBack->setIcon(QIcon(":/ic_arrow_back.png"));
        WebBoxToolBar->addAction(ActBack);
        
        
        QAction *ActForward = new QAction;
        ActForward->setIcon(QIcon(":/ic_arrow_forward_black_24dp.png"));
        WebBoxToolBar->addAction(ActForward);
        
        
        WebBoxToolBar->show();
           QWebEngineView *view = new QWebEngineView(WebBoxWindow);
            view->setWindowTitle("Nachschlagen im Web mit Google");
        
        
            view->setWindowIcon(QIcon(":/ic_web_black_24dp_1x.png"));
            view->load(QUrl("http://www.google.de/"));
        
        
        
        
        WebBoxWindow->setCentralWidget(view);
        view->show();
        WebBoxWindow->show();
        WebBoxWindow->addToolBar(WebBoxToolBar);
        WebBoxWindow->setWindowTitle("Nachschlagen im Web");
        
        
        connect(ActBack, &QAction::triggered, this, &PagesTextEdit::ActBackF);
        connect(ActForward, &QAction::triggered, this, &PagesTextEdit::ActForwardF);
        
        
         }
        
        
        Where is the error here?
        

        pagestextedit.obj:-1: Fehler: LNK2019: unresolved external symbol "public: void __cdecl PagesTextEdit::ActBackF(void)" (?ActBackF@PagesTextEdit@@QEAAXXZ) referenced in function "public: void __cdecl PagesTextEdit::WebBox(void)" (?WebBox@PagesTextEdit@@QEAAXXZ)

        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by
        #3

        There's no error in this particular snippet. You haven't provided a definition for the PagesTextEdit::ActBackF method, so that's why the linker's complaining.

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply
        1
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Yeah, or maybe just clean the project, re-run qmake, recompile and see if it links correctly then.

          1 Reply Last reply
          2
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            It works, thanks

            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