QUIRC error in OpenCV 4

Hey all of you,

I use OpenCV 4 and I try to decode a QR code using . The code compiles successfully but when I run the executable there is an error in the prompt:

Library QUIRC is not linked. No decoding is performed. Take it to the OpenCV repository.

Does anyone know how to fix this? I appreciated any kinds of help.

Regards, s0nc

which version, exactly ?
did you buil that locally ?

error means, that libquirc was not linked against the objdetect module, when building the opencv libs
(there isnt anything you can do, when building your program)

I use version 4.2.0 and build OpenCV locally on my machine.

It seems I have to build OpenCV again which is no problem so far. The code I used comes from the official website and is:

cd ..


mkdir OpenCV

OpenCV_Home_DIR=$(pwd)

sudo apt -y update
sudo apt -y upgrade

sudo apt -y remove x264 libx264-dev

sudo apt -y install build-essential checkinstall cmake pkg-config yasm
sudo apt -y install git gfortran
sudo apt -y install libjpeg8-dev libpng-dev

sudo apt -y install software-properties-common
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt -y update

sudo apt -y install libjasper1
sudo apt -y install libtiff5-dev

sudo apt -y install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev
sudo apt -y install libxine2-dev libv4l-dev
cd /usr/include/linux
sudo ln -s -f ../libv4l1-videodev.h videodev.h
cd "$OpenCV_Home_DIR"

sudo apt -y install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
sudo apt -y install libgtk2.0-dev libtbb-dev qt5-default
sudo apt -y install libatlas-base-dev
sudo apt -y install libfaac-dev libmp3lame-dev libtheora-dev
sudo apt -y install libvorbis-dev libxvidcore-dev
sudo apt -y install libopencore-amrnb-dev libopencore-amrwb-dev
sudo apt -y install libavresample-dev
sudo apt -y install x264 v4l-utils

sudo apt -y install libprotobuf-dev protobuf-compiler
sudo apt -y install libgoogle-glog-dev libgflags-dev
sudo apt -y install libgphoto2-dev libeigen3-dev libhdf5-dev doxygen

git clone https://github.com/opencv/opencv_contrib.git
cd opencv_contrib
git checkout tags/4.5.0
cd ..

git clone https://github.com/opencv/opencv.git
cd opencv
git checkout tags/4.5.0

mkdir build
cd build

cmake \
      -D CMAKE_BUILD_TYPE=RELEASE \
      -D CMAKE_INSTALL_PREFIX=$OpenCV_Home_DIR/installation/OpenCV \
      -D INSTALL_C_EXAMPLES=ON \
      -D WITH_TBB=ON \
      -D WITH_V4L=ON \
      -D WITH_OPENGL=ON \
      -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
      -D BUILD_EXAMPLES=ON \
      ..

make
sudo make install

cd $OpenCV_Home_DIR

Do I have to add something like -D WITH_QUIRC=ON \ to the cmake section?

Regards s0nc

I use version 4.2.0 and build it locally on my machine. The code to build OpenCV comes from the official website:

cd ..


mkdir OpenCV

OpenCV_Home_DIR=$(pwd)

sudo apt -y update
sudo apt -y upgrade

sudo apt -y remove x264 libx264-dev

sudo apt -y install build-essential checkinstall cmake pkg-config yasm
sudo apt -y install git gfortran
sudo apt -y install libjpeg8-dev libpng-dev

sudo apt -y install software-properties-common
sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt -y update

sudo apt -y install libjasper1
sudo apt -y install libtiff5-dev

sudo apt -y install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev
sudo apt -y install libxine2-dev libv4l-dev
cd /usr/include/linux
sudo ln -s -f ../libv4l1-videodev.h videodev.h
cd "$OpenCV_Home_DIR"

sudo apt -y install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
sudo apt -y install libgtk2.0-dev libtbb-dev qt5-default
sudo apt -y install libatlas-base-dev
sudo apt -y install libfaac-dev libmp3lame-dev libtheora-dev
sudo apt -y install libvorbis-dev libxvidcore-dev
sudo apt -y install libopencore-amrnb-dev libopencore-amrwb-dev
sudo apt -y install libavresample-dev
sudo apt -y install x264 v4l-utils

sudo apt -y install libprotobuf-dev protobuf-compiler
sudo apt -y install libgoogle-glog-dev libgflags-dev
sudo apt -y install libgphoto2-dev libeigen3-dev libhdf5-dev doxygen

git clone https://github.com/opencv/opencv_contrib.git
cd opencv_contrib
git checkout tags/4.2.0
cd ..

git clone https://github.com/opencv/opencv.git
cd opencv
git checkout tags/4.2.0

mkdir build
cd build

cmake \
      -D CMAKE_BUILD_TYPE=RELEASE \
      -D CMAKE_INSTALL_PREFIX=$OpenCV_Home_DIR/installation/OpenCV \
      -D INSTALL_C_EXAMPLES=ON \
      -D WITH_TBB=ON \
      -D WITH_V4L=ON \
      -D WITH_OPENGL=ON \
      -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
      -D BUILD_EXAMPLES=ON \
      ..

make
sudo make install

cd $OpenCV_Home_DIR

Do I have to add something like

-D WITH_QUIRC=ON \

to the cmake-section?

Regards s0nc

this should be on by default

I recently build OpenCV with the mentioned tag again but it did not work. When I tried to find the source of the error I only compiled this in the main:

QRCodeDetector qrDec;

This gained no errors. When I added

string str = qrDec.detectAndDecode(image, box, recImage);

It compiles without errors but when I run the executable the error occurs.

On Linux need to define -DBUILD_QUIRC=ON -DQUIRC=ON when building OpenCV, tested with 4.7 release. Unless you define BUILD_ - it will be searched under /usr/lib/*