Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. Compile problem for Raspberry Pi 3 with opencv
Forum Updated to NodeBB v4.3 + New Features

Compile problem for Raspberry Pi 3 with opencv

Scheduled Pinned Locked Moved Unsolved QtonPi
11 Posts 2 Posters 5.5k 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.
  • W Offline
    W Offline
    WillRpi
    wrote on last edited by
    #1

    Hello guys, I'm doing a project on Rpi 3, and I use QTcreator to make a GUI application. I also try to use opencv for my code. But the problem: when compiling, error
    *:-1: error: mainwindow.o: undefined reference to symbol '_ZN2cv6imreadERKNS_6StringEi'

    /usr/local/lib/libopencv_imgcodecs.so.3.0:-1: error: error adding symbols: DSO missing from command line*
    I dont know how to fix it. Anyone has suggestion? Thank you.
    This is my imported libraries in .pro file

    INCLUDEPATH += /usr/local/include
    INCLUDEPATH += /usr/local/include/opencv
    INCLUDEPATH += /usr/local/include/opencv2
    LIBS += -L/usr/local/lib
    LIBS += -lopencv_core
    LIBS += -lopencv_imgproc
    LIBS += -lopencv_highgui
    LIBS += -lopencv_ml
    LIBS += -lopencv_video
    LIBS += -lopencv_features2d
    LIBS += -lopencv_calib3d
    LIBS += -lopencv_objdetect
    LIBS += -lopencv_contrib
    LIBS += -lopencv_legacy
    LIBS += -lopencv_flann
    LIBS += -lopencv_nonfree

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

      Hi and welcome to devnet,

      Are you developing on the RPi3 directly ? Or are you cross-compiling ?

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

      W 1 Reply Last reply
      0
      • W Offline
        W Offline
        WillRpi
        wrote on last edited by
        #3

        I installed Qt and Qtcreator by "apt-get install qt5-default/qtcreator". Qtcreator run successfully without opencv.

        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi and welcome to devnet,

          Are you developing on the RPi3 directly ? Or are you cross-compiling ?

          W Offline
          W Offline
          WillRpi
          wrote on last edited by
          #4

          @SGaist Is it better if I reinstall QT by this guide: https://wiki.qt.io/Raspberry_Pi_Beginners_Guide ?

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

            You didn't answer my question: are you developing directly on the RPi3 ?

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

            W 1 Reply Last reply
            0
            • SGaistS SGaist

              You didn't answer my question: are you developing directly on the RPi3 ?

              W Offline
              W Offline
              WillRpi
              wrote on last edited by
              #6

              @SGaist Yes =D sr I'm a little bit confused

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

                Good then next question, did you build OpenCV yourself ? Or did you install the one from the distribution you have on your Pi ?

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

                W 1 Reply Last reply
                0
                • SGaistS SGaist

                  Good then next question, did you build OpenCV yourself ? Or did you install the one from the distribution you have on your Pi ?

                  W Offline
                  W Offline
                  WillRpi
                  wrote on last edited by
                  #8

                  @SGaist I built OpenCV due to this guide: http://www.pyimagesearch.com/2016/04/18/install-guide-raspberry-pi-3-raspbian-jessie-opencv-3/

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

                    You are missing -lopencv_imgcodecs in your .pro file.

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

                    W 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      You are missing -lopencv_imgcodecs in your .pro file.

                      W Offline
                      W Offline
                      WillRpi
                      wrote on last edited by
                      #10

                      @SGaist It works, thank you so much. Aw I didnt focus on this mistake.

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

                        You're welcome !

                        Since you have it working now, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

                        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

                        • Login

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