Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [Solved]Error in building Qt5.4 with MS Visual Studio 2010
Forum Updated to NodeBB v4.3 + New Features

[Solved]Error in building Qt5.4 with MS Visual Studio 2010

Scheduled Pinned Locked Moved Installation and Deployment
4 Posts 2 Posters 1.2k 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.
  • L Offline
    L Offline
    lilian_wang
    wrote on last edited by
    #1

    Hi, I am trying to use Qt in MS Visual Studio. I made a simple App using a pushButton to open a picture. But when I run the program, it prompts:
    error LNK2019: unresolved external symbol "private: void __thiscall myQtOpenCV::Open(void)"
    Open(void) is the slot function connected to the pushButton. It seems Open function is not working.
    I am not very good at programing, so I hope someone can help me to solve this problem.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Might be a silly question but did you implement that slot ? Even if it does nothing you need it.

      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
      • L Offline
        L Offline
        lilian_wang
        wrote on last edited by
        #3

        Thanks for your reply.
        I implemented it simply with OpenCV functions in the .cpp file:
        @void Open()
        {
        cv::Mat image = cv::imread("image.jpg");
        cv::namedWindow("Original Image");
        cv::imshow("Original Image", image);
        }
        @
        I can’t see where I went wrong. Here is the code in the .h file.
        @#ifndef MYQTOPENCV_H
        #define MYQTOPENCV_H

        #include <QtWidgets/QMainWindow>
        #include <QFileDialog>
        #include "ui_myqtopencv.h"
        #include "opencv2/opencv.hpp"

        class myQtOpenCV : public QMainWindow
        {
        Q_OBJECT

        public:
        myQtOpenCV(QWidget *parent = 0);
        ~myQtOpenCV();

        private:
        Ui::myQtOpenCVClass ui;

        private slots:
        void Open();
        };

        #endif // MYQTOPENCV_H
        @

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lilian_wang
          wrote on last edited by
          #4

          I have solved this problem. Just my silly mistake. The function should be implemented like this @void myQtOpenCV::Open(){}@

          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