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. Link / Build Error QtCreator 4.10.2, Qt 5.13, OpenCV, Ubuntu 18.04.
QtWS25 Last Chance

Link / Build Error QtCreator 4.10.2, Qt 5.13, OpenCV, Ubuntu 18.04.

Scheduled Pinned Locked Moved Solved General and Desktop
opencvlinkingubuntu 18.04
6 Posts 2 Posters 1.6k 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.
  • Pl45m4P Offline
    Pl45m4P Offline
    Pl45m4
    wrote on last edited by Pl45m4
    #1

    Hello guys,

    after upgrading my OS to 18.04 (from 16.04) and updating QtCreator / Qt I'm not able to link or include OpenCV in my projects.
    Even old projects, which haven't changed since last time don't work anymore.

    I included the OCV files as usual:

    #include "opencv2/imgproc.hpp"
    #include "opencv2/core.hpp"
    #include "opencv2/highgui.hpp"
    #include "opencv2/opencv.hpp"
    

    and added the linker paths to my pro-file:
    (I double checked these libs and paths, they should be correct and all files are actually there)

    INCLUDEPATH += /usr/local/include/opencv
    LIBS += -L/usr/local/lib -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_imgcodecs -lopencv_videoio
    

    Nevertheless I'm getting undefined reference to every OCV related stuff I'm trying to use.
    Starting with

    /usr/local/include/opencv2/core/cvstd.hpp:648: Error: undefined reference to `cv::String::deallocate()'
    

    followed by imgproc-ref errors everytime I want to use imread or anything else.

    The directory permissions dont look wrong as well...

    Anybody got an idea what could went wrong?
    Last time (some time ago) I've coded on this machine there was no error at all and everything worked fine.

    Classic case of "Never change a running system" ;-)

    TIA


    If debugging is the process of removing software bugs, then programming must be the process of putting them in.

    ~E. W. Dijkstra

    1 Reply Last reply
    0
    • SGaistS SGaist

      Why not use the version provided directly by Ubuntu ?

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by Pl45m4
      #6

      I still don't know what exactly went wrong, but after I removed all of the OpenCV stuff and re-installed a fresh v4.1, it worked. So even though I checked all lib-files, there must have been something wrong with the linked libs (Pointing to different versions?! Links not working?!, etc.)

      Thanks @SGaist, your answer made me remove everthing and try the OCV version that is provided by Ubuntu 18.04. I got 3.X.X from there... After I removed this version again (because I want a newer one) and installed 4.1 from OCV page, it worked :-)


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

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

        Hi,

        How did you install OpenCV ?
        What version are you using ?
        What version were you using before ?

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

        Pl45m4P 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          How did you install OpenCV ?
          What version are you using ?
          What version were you using before ?

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by Pl45m4
          #3

          @SGaist

          Looks like I have two OCV versions installed.... :)
          V.3 and 4.1 (4.1. is the latest)
          Both from github / sourceforge, following the guide from https://opencv.org/
          But all libs are there as v3 and v4.1 version, so it doesnt matter which version is actually in use?!

          I cant remember if I changed something else to make it run (PATH vars?! Further changes in QtCreator?!)


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

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

            Why not use the version provided directly by Ubuntu ?

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

            Pl45m4P 2 Replies Last reply
            1
            • SGaistS SGaist

              Why not use the version provided directly by Ubuntu ?

              Pl45m4P Offline
              Pl45m4P Offline
              Pl45m4
              wrote on last edited by Pl45m4
              #5

              @SGaist

              Does it make a difference?
              But I will give it a try tomorrow.

              I could swear I've added some additional parameters in the old QtCreator (not the .pro file) to link OCV libs. I've seen the option to set a Kit, but I can't find where I can edit things like that in the newer QtCreator versions. Normally I work with 4.7.X on Windows.
              (The QtCreator version on that linux machine was the one you can download from Ubuntu App Store. So not up-to-date. Actually quite outdated... 3.x.x, if I'm not mistaken, but it worked with OCV)


              If debugging is the process of removing software bugs, then programming must be the process of putting them in.

              ~E. W. Dijkstra

              1 Reply Last reply
              0
              • SGaistS SGaist

                Why not use the version provided directly by Ubuntu ?

                Pl45m4P Offline
                Pl45m4P Offline
                Pl45m4
                wrote on last edited by Pl45m4
                #6

                I still don't know what exactly went wrong, but after I removed all of the OpenCV stuff and re-installed a fresh v4.1, it worked. So even though I checked all lib-files, there must have been something wrong with the linked libs (Pointing to different versions?! Links not working?!, etc.)

                Thanks @SGaist, your answer made me remove everthing and try the OCV version that is provided by Ubuntu 18.04. I got 3.X.X from there... After I removed this version again (because I want a newer one) and installed 4.1 from OCV page, it worked :-)


                If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                ~E. W. Dijkstra

                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