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. Linking OpenCV 3.2.0 library with Qt 5.4
Forum Updated to NodeBB v4.3 + New Features

Linking OpenCV 3.2.0 library with Qt 5.4

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 5 Posters 2.5k Views 4 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.
  • S Offline
    S Offline
    Syazwany
    wrote on last edited by
    #1

    I had downloaded the libraries for OpenCV and wanted to connect it to Qt for my project. I am doing this on Windows 10. I want to develop a GUI that would be able to upload and play video. But I have an error saying that "No such file or directory"

    .pro file
    INCLUDEPATH += C:/opencv-3.2.0-vc14/opencv/build/include/opencv2

    LIBS += LC:/opencv-3.2.0-vc14/opencv/build/bin -libopencv_core -libopencv_imgproc -libopencv_highgui

    header file
    #ifndef DIALOG_H
    #define DIALOG_H

    #include<opencv2/core/core.hpp>
    #include<opencv2/highgui/highgui.hpp>
    #include<opencv2/imgproc/imgproc.hpp>
    #include<opencv2/core/types.hpp>

    #include <QDialog>

    namespace Ui {
    class Dialog;
    }

    class Dialog : public QDialog
    {
    Q_OBJECT

    public:
    explicit Dialog(QWidget *parent = 0);
    ~Dialog();

    public slots:
    void processFrameAndUpdateGUI();

    private slots:
    void on_btnPauseOrResume_clicked();

    private:
    Ui::Dialog *ui;

    // Declare variables while linking them to opencv libraries
    

    error message
    error: opencv2/core/core.hpp: No such file or directory
    #include<opencv2/core/core.hpp>
    ^

    1 Reply Last reply
    0
    • mrjjM mrjj

      Hi

      But if you are using mingw compiler and that opencv-3.2.0-vc14 really sounds like visual studio compiler.

      Are we not trying to use visual studio DLLS with mingw compiler ?

      I assume you did not build openCV yourself but just downloaded and unpacked it ?

      S Offline
      S Offline
      Syazwany
      wrote on last edited by
      #10

      @mrjj Hey there. Thank you so much. That was the problem. I thought i built it.

      It works now :)

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

        Hi and welcome to devnet,

        Remove the opencv2 at the end of your INCLUDEPATH statement.

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

        S 1 Reply Last reply
        2
        • SGaistS SGaist

          Hi and welcome to devnet,

          Remove the opencv2 at the end of your INCLUDEPATH statement.

          S Offline
          S Offline
          Syazwany
          wrote on last edited by
          #3

          Hi @SGaist

          Now this error appears
          error: error: LC:/opencv-3.2.0-vc14/opencv/build/bin: Invalid argument

          mrjjM 1 Reply Last reply
          0
          • S Syazwany

            Hi @SGaist

            Now this error appears
            error: error: LC:/opencv-3.2.0-vc14/opencv/build/bin: Invalid argument

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @Syazwany
            And you are using the same compiler for your app ?
            (visual studio 2015 i think it is)

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

              You are missing a - before the L in your LIBS statement.

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

              S 1 Reply Last reply
              2
              • mrjjM mrjj

                @Syazwany
                And you are using the same compiler for your app ?
                (visual studio 2015 i think it is)

                S Offline
                S Offline
                Syazwany
                wrote on last edited by
                #6

                @mrjj Hi, I am using MinGW compiler. I am new to this and been dealing with this error for more than a week now :(

                jsulmJ 1 Reply Last reply
                0
                • S Syazwany

                  @mrjj Hi, I am using MinGW compiler. I am new to this and been dealing with this error for more than a week now :(

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

                  @Syazwany As already mentioned you're missing - in front of L:

                  LIBS += -LC:/opencv-3.2.0-vc14/opencv/build/bin -libopencv_core -libopencv_imgproc -libopencv_highgui
                  

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

                  1 Reply Last reply
                  0
                  • SGaistS SGaist

                    You are missing a - before the L in your LIBS statement.

                    S Offline
                    S Offline
                    Syazwany
                    wrote on last edited by
                    #8

                    @SGaist Still does not work, the same error :(

                    1 Reply Last reply
                    0
                    • mrjjM Offline
                      mrjjM Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on last edited by
                      #9

                      Hi

                      But if you are using mingw compiler and that opencv-3.2.0-vc14 really sounds like visual studio compiler.

                      Are we not trying to use visual studio DLLS with mingw compiler ?

                      I assume you did not build openCV yourself but just downloaded and unpacked it ?

                      S 1 Reply Last reply
                      2
                      • mrjjM mrjj

                        Hi

                        But if you are using mingw compiler and that opencv-3.2.0-vc14 really sounds like visual studio compiler.

                        Are we not trying to use visual studio DLLS with mingw compiler ?

                        I assume you did not build openCV yourself but just downloaded and unpacked it ?

                        S Offline
                        S Offline
                        Syazwany
                        wrote on last edited by
                        #10

                        @mrjj Hey there. Thank you so much. That was the problem. I thought i built it.

                        It works now :)

                        1 Reply Last reply
                        1
                        • Pablo J. RoginaP Offline
                          Pablo J. RoginaP Offline
                          Pablo J. Rogina
                          wrote on last edited by
                          #11

                          @Syazwany if your issue is solved, please don't forget to mark your post as such. Thank you

                          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
                          1

                          • Login

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