# HAVE\_QT is not defined?

**URL:** https://discourse.cmake.org/t/have-qt-is-not-defined/10200
**Category:** Usage
**Tags:** os:linux
**Created:** [February 27, 2024, 5:44am UTC](https://discourse.cmake.org/t/have-qt-is-not-defined/10200 "2024-02-27T05:44:11Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Tariq](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/t/ba9def/32.png) [@Tariq](https://discourse.cmake.org/u/Tariq)
#### Post date: [February 27, 2024, 5:44am UTC](https://discourse.cmake.org/t/have-qt-is-not-defined/10200/1 "2024-02-27T05:44:11Z")

</div>

Hi, I was trying to build opencv 4.5.5 on Linux Mint 21.3 with the cvv module from opencv-contrib. I used the following to do so

```bash
cd /tmp
# Download OpenCV
wget -q https://github.com/opencv/opencv/archive/4.5.5.zip
unzip -q 4.5.5.zip && rm -rf 4.5.5.zip
# Download aruco module (optional)
wget -q https://github.com/opencv/opencv_contrib/archive/refs/tags/4.5.5.zip -O opencv_contrib-4.5.5.zip
unzip -q opencv_contrib-4.5.5.zip && rm -rf opencv_contrib-4.5.5.zip
mkdir -p extra && mv opencv_contrib-4.5.5/modules/aruco && mv opencv_contrib-4.5.5/modules/cvv mv opencv_contrib-4.5.5/modules/xfeatures2d extra
cd opencv-4.5.5
mkdir -p build && cd build
cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr/local \
    -DBUILD_DOCS=OFF \
    -DBUILD_EXAMPLES=OFF \
    -DBUILD_JASPER=OFF \
    -DBUILD_OPENEXR=OFF \
    -DBUILD_PERF_TESTS=OFF \
    -DBUILD_TESTS=OFF \
    -DBUILD_PROTOBUF=OFF \
    -DBUILD_opencv_apps=OFF \
    -DBUILD_opencv_dnn=OFF \
    -DBUILD_opencv_ml=OFF \
    -DBUILD_opencv_python_bindings_generator=OFF \
    -DENABLE_CXX11=ON \
    -DENABLE_FAST_MATH=ON \
    -DWITH_EIGEN=ON \
    -DWITH_FFMPEG=ON \
    -DWITH_TBB=ON \
    -DWITH_OPENMP=ON \
    -DOPENCV_EXTRA_MODULES_PATH=/tmp/extra \
    ..
make -j4 && sudo make install

```

But I kept getting that cvv was unavailable. When I dug into it, I found that in the CMakeLists.txt for cvv it has

```cmake
if(NOT HAVE_QT OR NOT HAVE_CXX11 OR QT_VERSION_MAJOR LESS 5)
  ocv_module_disable(cvv)
  return()
endif()

```

When I tried debugging I found that `HAVE_QT` and `HAVE_CX11` and `QT_VERSION_MAJOR` were all not defined (i.e I added in the if statement `message(VAR="${VAR}")` for each of these). Why would they not be defined? I installed qt5 using apt. When I remove this check and try to make I get QString not being defined. Do I need to build Qt5 from source for some reason?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [February 27, 2024, 2:31pm UTC](https://discourse.cmake.org/t/have-qt-is-not-defined/10200/2 "2024-02-27T14:31:38Z")

</div>

> [@Tariq](#):
>
> ```auto
> -DWITH_EIGEN=ON \
> -DWITH_FFMPEG=ON \
> -DWITH_TBB=ON \
> -DWITH_OPENMP=ON \
> 
> ```

Maybe you want to tell OpenCV that you have them? It could be that OpenCV doesn’t search without being told.
