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. Cross compile with OpenCV (Raspberry Pi4)

Cross compile with OpenCV (Raspberry Pi4)

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 1.0k 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.
  • A Offline
    A Offline
    Andrea_M
    wrote on last edited by
    #1

    Hello to everyone,
    I just set a Qt 5.15.2 for cross-compile (host is a Linux Mint 20.2 PC, target is a Raspberry 4 with Raspberry OS 32 bit).
    I tested it with some Qt examples, an all seems to be ok.
    As I need OpenCV, I installed on Raspberry (by apt-get) the libopencv*-dev, located on path:
    usr/lib/arm-linux-gnueabihf
    and synced directories and links on my host machine .The OpenCV path in sysroot is:
    /home/myUser/raspi/sysroot/lib/arm-linux-gnueabihf

    Compiling the code from my host I have:
    i- undefined reference to cv::String::deallocate()' i- undefined reference to cv::String::deallocate()'
    i- undefined reference to cv::VideoCapture::VideoCapture()' i- undefined reference to cv::VideoWriter::VideoWriter()'
    i- undefined reference to `cv::VideoWriter::~VideoWriter()'
    ...

    that is caused, in my opinion, by opencv libraries not found.
    My *.pro file has this code

    [...]
    # FOR FEDORA
         LIBS += -L"/usr/local/lib64/"
    # FOR UBUNTU
         LIBS += -L"/usr/local/lib/"
    # FOR RASPBERRY
         LIBS += -L"usr/lib/arm-linux-gnueabihf"
         LIBS += -L"/home/myUser/raspi/sysroot/lib/arm-linux-gnueabihf"
    
         LIBS += -lopencv_calib3d
         LIBS += -lopencv_core
         LIBS += -lopencv_features2d
         LIBS += -lopencv_flann
         LIBS += -lopencv_highgui
         LIBS += -lopencv_imgcodecs
    [...]
    

    and compiling it under Linux OS with native Gcc, it does't give me any error (libs are located in /usr/local/lib/).
    So, I suppose that I'm doing something wrong with OpenCv,but I can't understand what is the fault...

    jsulmJ 1 Reply Last reply
    0
    • A Andrea_M

      Hello to everyone,
      I just set a Qt 5.15.2 for cross-compile (host is a Linux Mint 20.2 PC, target is a Raspberry 4 with Raspberry OS 32 bit).
      I tested it with some Qt examples, an all seems to be ok.
      As I need OpenCV, I installed on Raspberry (by apt-get) the libopencv*-dev, located on path:
      usr/lib/arm-linux-gnueabihf
      and synced directories and links on my host machine .The OpenCV path in sysroot is:
      /home/myUser/raspi/sysroot/lib/arm-linux-gnueabihf

      Compiling the code from my host I have:
      i- undefined reference to cv::String::deallocate()' i- undefined reference to cv::String::deallocate()'
      i- undefined reference to cv::VideoCapture::VideoCapture()' i- undefined reference to cv::VideoWriter::VideoWriter()'
      i- undefined reference to `cv::VideoWriter::~VideoWriter()'
      ...

      that is caused, in my opinion, by opencv libraries not found.
      My *.pro file has this code

      [...]
      # FOR FEDORA
           LIBS += -L"/usr/local/lib64/"
      # FOR UBUNTU
           LIBS += -L"/usr/local/lib/"
      # FOR RASPBERRY
           LIBS += -L"usr/lib/arm-linux-gnueabihf"
           LIBS += -L"/home/myUser/raspi/sysroot/lib/arm-linux-gnueabihf"
      
           LIBS += -lopencv_calib3d
           LIBS += -lopencv_core
           LIBS += -lopencv_features2d
           LIBS += -lopencv_flann
           LIBS += -lopencv_highgui
           LIBS += -lopencv_imgcodecs
      [...]
      

      and compiling it under Linux OS with native Gcc, it does't give me any error (libs are located in /usr/local/lib/).
      So, I suppose that I'm doing something wrong with OpenCv,but I can't understand what is the fault...

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

      @Andrea_M said in Cross compile with OpenCV (Raspberry Pi4):

      -L"usr/lib/arm-linux-gnueabihf"

      / is missing at the beginning of the path.
      Since you are using a sysroot you should not specify the whole path including the sysroot path as lib path! You specify the lib path as if you would build directly on RaspberryPi. There is also usually no need to specify the system lib folders explicetly as those are searched by linker by default.

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

      1 Reply Last reply
      2
      • A Offline
        A Offline
        Andrea_M
        wrote on last edited by
        #3

        Thank you very much!
        I tried with :

        # FOR RASPBERRY
             LIBS += -L"/usr/local/"
             LIBS += -L"/lib/arm-linux-gnueabihf/"
             LIBS += -L"/usr/lib/arm-linux-gnueabihf/"
        
             LIBS += -lopencv_calib3d
             LIBS += -lopencv_core
             LIBS += -lopencv_features2d
             LIBS += -lopencv_flann
             LIBS += -lopencv_highgui
        

        but without success. I tried to resolve creating a symbolic link into main program directory, in debug directory... nothing, I'm afraid it could be a different problem, so I'll try to compile openCV in Raspeberry device, and then sync it.
        Compiling openCV in linux was rather simple, I hope in Rasperry would be the same!

        jsulmJ 1 Reply Last reply
        0
        • A Andrea_M

          Thank you very much!
          I tried with :

          # FOR RASPBERRY
               LIBS += -L"/usr/local/"
               LIBS += -L"/lib/arm-linux-gnueabihf/"
               LIBS += -L"/usr/lib/arm-linux-gnueabihf/"
          
               LIBS += -lopencv_calib3d
               LIBS += -lopencv_core
               LIBS += -lopencv_features2d
               LIBS += -lopencv_flann
               LIBS += -lopencv_highgui
          

          but without success. I tried to resolve creating a symbolic link into main program directory, in debug directory... nothing, I'm afraid it could be a different problem, so I'll try to compile openCV in Raspeberry device, and then sync it.
          Compiling openCV in linux was rather simple, I hope in Rasperry would be the same!

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

          @Andrea_M Please post the whole build log, especially the linker part.

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

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

            I suppose it is a compatibility problem, because the compiler can find the opencv libs, but a problem accours. For example:

            /home/myUser/raspi/sysroot/usr/include/opencv2/core/cvstd.inl.hpp:81: undefined reference to `cv::String::allocate(unsigned int)'
            

            @jsulm
            Sorry, I'm not sure about what do you mean with "build log"... is something like this?

            11:45:03: Starting: "/usr/bin/make" -j4
            Makefile:28197: warning: overriding recipe for target 'ui_session_database.h'
            Makefile:20200: warning: ignoring old recipe for target 'ui_session_database.h'
            /home/myUser/raspi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/myUser/raspi/sysroot -Wl,-rpath,/usr/local/qt5pi/lib -Wl,-rpath-link,/home/myUser/raspi/qt5pi/lib -Wl,-rpath-link,/home/myUser/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/myUser/raspi/sysroot/lib/arm-linux-gnueabihf -o QtopenCV csv_output.o calibration.o create_test.o reportdb_exp.o resultdb_exp.o selection_export.o selectsession.o eye.o MyTimerClass.o editablesqlmodel.o fullscreen.o mediabrowser.o alarm.o send_data.o send_instruction.o [...all *.o file...]   /home/myUser/raspi/qt5pi/lib/libQt5PrintSupport.so /home/myUser/raspi/qt5pi/lib/libQt5MultimediaWidgets.so /home/myUser/raspi/qt5pi/lib/libQt5Widgets.so /home/myUser/raspi/qt5pi/lib/libQt5Multimedia.so /home/myUser/raspi/qt5pi/lib/libQt5Gui.so /home/myUser/raspi/qt5pi/lib/libQt5Sql.so /home/myUser/raspi/qt5pi/lib/libQt5Qml.so /home/myUser/raspi/qt5pi/lib/libQt5Network.so /home/myUser/raspi/qt5pi/lib/libQt5SerialPort.so /home/myUser/raspi/qt5pi/lib/libQt5Core.so -L/home/myUser/raspi/sysroot/usr/lib/arm-linux-gnueabihf -lGLESv2 -lpthread   
            calibration.o: In function `cv::String::~String()':
            /home/myUser/raspi/sysroot/usr/include/opencv2/core/cvstd.hpp:664: undefined reference to `cv::String::deallocate()'
            calibration.o: In function `cv::String::operator=(cv::String const&)':
            /home/myUser/raspi/sysroot/usr/include/opencv2/core/cvstd.hpp:672: undefined reference to `cv::String::deallocate()'
            eye.o: In function `eye::eye(QWidget*)':
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:42: undefined reference to `cv::VideoCapture::VideoCapture()'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:42: undefined reference to `cv::VideoCapture::VideoCapture()'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:42: undefined reference to `cv::VideoWriter::VideoWriter()'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:42: undefined reference to `cv::VideoWriter::~VideoWriter()'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:42: undefined reference to `cv::VideoCapture::~VideoCapture()'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:42: undefined reference to `cv::VideoCapture::~VideoCapture()'
            eye.o: In function `eye::~eye()':
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:74: undefined reference to `cv::VideoWriter::~VideoWriter()'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:74: undefined reference to `cv::VideoCapture::~VideoCapture()'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:74: undefined reference to `cv::VideoCapture::~VideoCapture()'
            eye.o: In function `eye::initCamera()':
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:83: undefined reference to `cv::VideoCapture::open(int)'
            eye.o: In function `eye::initVideo()':
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:89: undefined reference to `cv::VideoCapture::read(cv::_OutputArray const&)'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:105: undefined reference to `cv::VideoWriter::fourcc(char, char, char, char)'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:108: undefined reference to `cv::VideoCapture::get(int) const'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:108: undefined reference to `cv::VideoCapture::get(int) const'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:109: undefined reference to `cv::VideoWriter::VideoWriter(cv::String const&, int, double, cv::Size_<int>, bool)'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:109: undefined reference to `cv::VideoWriter::~VideoWriter()'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:109: undefined reference to `cv::VideoWriter::~VideoWriter()'
            eye.o: In function `eye::processGui()':
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:117: undefined reference to `cv::VideoCapture::read(cv::_OutputArray const&)'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:120: undefined reference to `cv::VideoWriter::write(cv::Mat const&)'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:121: undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:122: undefined reference to `cv::putText(cv::_InputOutputArray const&, cv::String const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:125: undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
            eye.o: In function `eye::on_record_clicked()':
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:144: undefined reference to `cv::VideoCapture::isOpened() const'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:146: undefined reference to `cv::VideoCapture::release()'
            eye.o: In function `eye::on_CaptureButton_clicked()':
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:177: undefined reference to `cv::VideoCapture::read(cv::_OutputArray const&)'
            /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:194: undefined reference to `cv::imwrite(cv::String const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)'
            eye.o: In function `cv::String::String(char const*)':
            /home/myUser/raspi/sysroot/usr/include/opencv2/core/cvstd.hpp:622: undefined reference to `cv::String::allocate(unsigned int)'
            eye.o: In function `cv::Mat::~Mat()':
            /home/myUser/raspi/sysroot/usr/include/opencv2/core/mat.inl.hpp:592: undefined reference to `cv::fastFree(void*)'
            eye.o: In function `cv::Mat::release()':
            /home/myUser/raspi/sysroot/usr/include/opencv2/core/mat.inl.hpp:704: undefined reference to `cv::Mat::deallocate()'
            eye.o: In function `cv::String::String(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
            /home/myUser/raspi/sysroot/usr/include/opencv2/core/cvstd.inl.hpp:81: undefined reference to `cv::String::allocate(unsigned int)'
            collect2: error: ld returned 1 exit status
            make: *** [Makefile:642: QtopenCV] Error 1
            11:45:09: The process "/usr/bin/make" exited with code 2.
            Error while building/deploying project Login (kit: Raspberry Pi4 )
            When executing step "Make"
            

            This log appears not complete, because I need to do a clear after switching from a configuration to another... it's just an example.
            I'll update this thread after compiling opencv on Raspberry.

            jsulmJ 1 Reply Last reply
            0
            • A Andrea_M

              I suppose it is a compatibility problem, because the compiler can find the opencv libs, but a problem accours. For example:

              /home/myUser/raspi/sysroot/usr/include/opencv2/core/cvstd.inl.hpp:81: undefined reference to `cv::String::allocate(unsigned int)'
              

              @jsulm
              Sorry, I'm not sure about what do you mean with "build log"... is something like this?

              11:45:03: Starting: "/usr/bin/make" -j4
              Makefile:28197: warning: overriding recipe for target 'ui_session_database.h'
              Makefile:20200: warning: ignoring old recipe for target 'ui_session_database.h'
              /home/myUser/raspi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/myUser/raspi/sysroot -Wl,-rpath,/usr/local/qt5pi/lib -Wl,-rpath-link,/home/myUser/raspi/qt5pi/lib -Wl,-rpath-link,/home/myUser/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/myUser/raspi/sysroot/lib/arm-linux-gnueabihf -o QtopenCV csv_output.o calibration.o create_test.o reportdb_exp.o resultdb_exp.o selection_export.o selectsession.o eye.o MyTimerClass.o editablesqlmodel.o fullscreen.o mediabrowser.o alarm.o send_data.o send_instruction.o [...all *.o file...]   /home/myUser/raspi/qt5pi/lib/libQt5PrintSupport.so /home/myUser/raspi/qt5pi/lib/libQt5MultimediaWidgets.so /home/myUser/raspi/qt5pi/lib/libQt5Widgets.so /home/myUser/raspi/qt5pi/lib/libQt5Multimedia.so /home/myUser/raspi/qt5pi/lib/libQt5Gui.so /home/myUser/raspi/qt5pi/lib/libQt5Sql.so /home/myUser/raspi/qt5pi/lib/libQt5Qml.so /home/myUser/raspi/qt5pi/lib/libQt5Network.so /home/myUser/raspi/qt5pi/lib/libQt5SerialPort.so /home/myUser/raspi/qt5pi/lib/libQt5Core.so -L/home/myUser/raspi/sysroot/usr/lib/arm-linux-gnueabihf -lGLESv2 -lpthread   
              calibration.o: In function `cv::String::~String()':
              /home/myUser/raspi/sysroot/usr/include/opencv2/core/cvstd.hpp:664: undefined reference to `cv::String::deallocate()'
              calibration.o: In function `cv::String::operator=(cv::String const&)':
              /home/myUser/raspi/sysroot/usr/include/opencv2/core/cvstd.hpp:672: undefined reference to `cv::String::deallocate()'
              eye.o: In function `eye::eye(QWidget*)':
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:42: undefined reference to `cv::VideoCapture::VideoCapture()'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:42: undefined reference to `cv::VideoCapture::VideoCapture()'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:42: undefined reference to `cv::VideoWriter::VideoWriter()'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:42: undefined reference to `cv::VideoWriter::~VideoWriter()'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:42: undefined reference to `cv::VideoCapture::~VideoCapture()'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:42: undefined reference to `cv::VideoCapture::~VideoCapture()'
              eye.o: In function `eye::~eye()':
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:74: undefined reference to `cv::VideoWriter::~VideoWriter()'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:74: undefined reference to `cv::VideoCapture::~VideoCapture()'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:74: undefined reference to `cv::VideoCapture::~VideoCapture()'
              eye.o: In function `eye::initCamera()':
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:83: undefined reference to `cv::VideoCapture::open(int)'
              eye.o: In function `eye::initVideo()':
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:89: undefined reference to `cv::VideoCapture::read(cv::_OutputArray const&)'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:105: undefined reference to `cv::VideoWriter::fourcc(char, char, char, char)'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:108: undefined reference to `cv::VideoCapture::get(int) const'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:108: undefined reference to `cv::VideoCapture::get(int) const'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:109: undefined reference to `cv::VideoWriter::VideoWriter(cv::String const&, int, double, cv::Size_<int>, bool)'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:109: undefined reference to `cv::VideoWriter::~VideoWriter()'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:109: undefined reference to `cv::VideoWriter::~VideoWriter()'
              eye.o: In function `eye::processGui()':
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:117: undefined reference to `cv::VideoCapture::read(cv::_OutputArray const&)'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:120: undefined reference to `cv::VideoWriter::write(cv::Mat const&)'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:121: undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:122: undefined reference to `cv::putText(cv::_InputOutputArray const&, cv::String const&, cv::Point_<int>, int, double, cv::Scalar_<double>, int, int, bool)'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:125: undefined reference to `cv::cvtColor(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
              eye.o: In function `eye::on_record_clicked()':
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:144: undefined reference to `cv::VideoCapture::isOpened() const'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:146: undefined reference to `cv::VideoCapture::release()'
              eye.o: In function `eye::on_CaptureButton_clicked()':
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:177: undefined reference to `cv::VideoCapture::read(cv::_OutputArray const&)'
              /home/myUser/Scrivania/build-Login-Raspberry_Pi4-Debug/../QT_2021_10_08/Program/Eye/eye.cpp:194: undefined reference to `cv::imwrite(cv::String const&, cv::_InputArray const&, std::vector<int, std::allocator<int> > const&)'
              eye.o: In function `cv::String::String(char const*)':
              /home/myUser/raspi/sysroot/usr/include/opencv2/core/cvstd.hpp:622: undefined reference to `cv::String::allocate(unsigned int)'
              eye.o: In function `cv::Mat::~Mat()':
              /home/myUser/raspi/sysroot/usr/include/opencv2/core/mat.inl.hpp:592: undefined reference to `cv::fastFree(void*)'
              eye.o: In function `cv::Mat::release()':
              /home/myUser/raspi/sysroot/usr/include/opencv2/core/mat.inl.hpp:704: undefined reference to `cv::Mat::deallocate()'
              eye.o: In function `cv::String::String(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
              /home/myUser/raspi/sysroot/usr/include/opencv2/core/cvstd.inl.hpp:81: undefined reference to `cv::String::allocate(unsigned int)'
              collect2: error: ld returned 1 exit status
              make: *** [Makefile:642: QtopenCV] Error 1
              11:45:09: The process "/usr/bin/make" exited with code 2.
              Error while building/deploying project Login (kit: Raspberry Pi4 )
              When executing step "Make"
              

              This log appears not complete, because I need to do a clear after switching from a configuration to another... it's just an example.
              I'll update this thread after compiling opencv on Raspberry.

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

              @Andrea_M It looks like the OpenCV libs are not passed to the linker.
              Do a complete rebuild: delete build folder, run qmake and build.

              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