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. Including OpenCV library files to Qt in ubuntu
Forum Updated to NodeBB v4.3 + New Features

Including OpenCV library files to Qt in ubuntu

Scheduled Pinned Locked Moved Installation and Deployment
17 Posts 6 Posters 22.0k 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
    lgeyer
    wrote on last edited by
    #2

    qmakes "LIBS":http://doc.qt.nokia.com/latest/qmake-variable-reference.html#libs variable can be used to add additional libraries.
    @
    LIBS += -L<path_to_libraries>
    LIBS += -l<library>
    @

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Fomand
      wrote on last edited by
      #3
      1. Open your project in Qt Creator.
      2. In the panel "Projects" click on the file ...pro.
      3. add there:
        @
        LIBS += -lyour_lib1
        LIBS += -lyour_lib2
        LIBS += -lyour_lib3
        ...
        @

      or

      @
      LIBS += -Lpath1
      LIBS += -Lpath2
      ...
      @
      Lukas explained the format: capital L - all libraries from the path; low L (l) - one library;

      1 Reply Last reply
      0
      • K Offline
        K Offline
        koahnig
        wrote on last edited by
        #4

        [quote author="Fomand" date="1315205373"]capital L - all libraries from the path
        [/quote]

        I think this statement is not completely right.
        Capital 'L' defines a library path. Lower case 'l' defines individual libraries.
        However, defining the path of libs with 'L' provides certainly the location to search for libs, which might be added using 'l'. The documentation does not state that all libs under that path will be used.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • A Offline
          A Offline
          a4able
          wrote on last edited by
          #5

          i installed opencv using opencv.tar.gz
          so can you please help me in finding the library path
          iam new to ubuntu so pls help
          dont know where these libraries are...

          1 Reply Last reply
          0
          • A Offline
            A Offline
            a4able
            wrote on last edited by
            #6

            <path to libraries>?
            how can i find the path

            1 Reply Last reply
            0
            • F Offline
              F Offline
              Fomand
              wrote on last edited by
              #7

              find /home/ -name "Qt*"

              will find all files in /home/ recursively - files with the name starting from Qt.

              apt-show-versions

              will show the installed versions of packages.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                a4able
                wrote on last edited by
                #8

                @Formand iam sorry
                where actually the OpenCV library files are present
                dont know much about ubuntu

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  a4able
                  wrote on last edited by
                  #9

                  LIBS += -L<path_to_libraries>
                  LIBS += -l<library>
                  cant understand the <path to libraries>
                  how can i find the path of opencv library

                  1 Reply Last reply
                  0
                  • sierdzioS Offline
                    sierdzioS Offline
                    sierdzio
                    Moderators
                    wrote on last edited by
                    #10

                    if you've installed OpenCV properly, it would probably reside somewhere in /usr/lib, /lib, /usr/local/lib. But I won't guarantee, I've never used it. Might as well be in /home/<username>/opencv/lib or similar.

                    But, if everything is installed properly, you would just have to
                    @
                    #include <cv.h>
                    @

                    (Z(:^

                    1 Reply Last reply
                    0
                    • F Offline
                      F Offline
                      Fomand
                      wrote on last edited by
                      #11

                      Read this about OpenCV file names "here":http://packages.debian.org/source/sid/opencv .
                      And I am on Debian currently - not on Ubuntu.

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        a4able
                        wrote on last edited by
                        #12

                        i think u dont understand the question
                        to use the opencv lirary in Qt for example
                        #include<highgui.hpp> the path of the particular header file has to be specified in the Qt
                        how to tell qt where to look for the header file
                        inbuilt header files can be directly but that of opencv cant

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          a4able
                          wrote on last edited by
                          #13

                          pls help me..........

                          1 Reply Last reply
                          0
                          • M Offline
                            M Offline
                            mlong
                            wrote on last edited by
                            #14

                            Please be patient when waiting for answers. While we understand that you need help, we're all doing this on our free time and will help you as we can. Begging does not speed things up.

                            You need to add your path to your OpenCV header files in the "INCLUDEPATH":http://doc.qt.nokia.com/latest/qmake-variable-reference.html#includepath variable in your .pro file.

                            Software Engineer
                            My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                            1 Reply Last reply
                            0
                            • L Offline
                              L Offline
                              lgeyer
                              wrote on last edited by
                              #15

                              If you have downloaded the source tarball from the OpenCV website you will have to build the library first. There is an extensive "InstallGuide":http://opencv.willowgarage.com/wiki/InstallGuide right where you downloaded OpenCV.

                              If you have installed OpenCV using your distributions package manager (preferred) the library is already built and installed at the proper location. Use @dpkg --listfiles name-of-opencv-package@ to verify that the libraries have been installed to /usr/lib.

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                a4able
                                wrote on last edited by
                                #16

                                !http://photos.cc.fbcdn.net/hphotos-cc-ash4/299125_212360362157627_100001509941792_597819_483414201_n.jpg!
                                cant understand what the error is

                                [EDIT: fixed image link, Volker]

                                1 Reply Last reply
                                0
                                • sierdzioS Offline
                                  sierdzioS Offline
                                  sierdzio
                                  Moderators
                                  wrote on last edited by
                                  #17

                                  [quote author="a4able" date="1315554387"]!http://photos.cc.fbcdn.net/hphotos-cc-ash4/299125_212360362157627_100001509941792_597819_483414201_n.jpg()!
                                  cant understand what the error is[/quote]

                                  This does not look Qt-related in any way, you are not using any Qt libs in your project. Does imgshow() require cv::Mat, or maybe a pointer? Or maybe methods do not expect char *[] strings?

                                  (Z(:^

                                  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