# Warning messages when building OpenCV with opencv\_contrib

**URL:** <https://forum.opencv.org/t/warning-messages-when-building-opencv-with-opencv-contrib/10953>\
**Category:** Android/Java\
**Tags:** build\
**Created:** [November 14, 2022, 5:37pm UTC](https://forum.opencv.org/t/warning-messages-when-building-opencv-with-opencv-contrib/10953 "2022-11-14T17:37:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tamada](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@Tamada](https://forum.opencv.org/u/Tamada)\
**Post date:** [November 14, 2022, 5:37pm UTC](https://forum.opencv.org/t/warning-messages-when-building-opencv-with-opencv-contrib/10953/1 "2022-11-14T17:37:11Z")

</div>

Hi! I want to build OpenCV with opencv\_contrib for Android. I’m using [this](https://nhancv.medium.com/build-opencv-opencv-contrib-for-android-on-windows-9894b4fe6386) guide. But when I write make, I get such errors:

```auto
E:\OpenCV\opencv\3rdparty\carotene\src\div.cpp:161:19: warning: implicit conversion from
      'std::numeric_limits<int>::type' (aka 'int') to 'float' changes value from 2147483647 to 2147483648
      [-Wimplicit-const-int-float-conversion]
         (scale * std::numeric_limits<T>::max()) > -1.0f))
                ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E:\OpenCV\opencv\3rdparty\carotene\src\div.cpp:453:5: note: in instantiation of function template specialization
      'carotene_o4t::(anonymous namespace)::div<int>' requested here
    div<s32>(size, src0Base, src0Stride, src1Base, src1Stride, dstBase, dstStride, scale, cpolicy);
    ^
E:\OpenCV\opencv\3rdparty\carotene\src\div.cpp:160:19: warning: implicit conversion from
      'std::numeric_limits<int>::type' (aka 'int') to 'float' changes value from 2147483647 to 2147483648
      [-Wimplicit-const-int-float-conversion]
         (scale * std::numeric_limits<T>::max()) < 1.0f &&
                ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.

```

Is this normal? If not, how can I fix it?

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [November 14, 2022, 6:17pm UTC](https://forum.opencv.org/t/warning-messages-when-building-opencv-with-opencv-contrib/10953/2 "2022-11-14T18:17:25Z")

</div>

you could try disabling the build of _tests_. dig around in the cmake gui to find the right variables.

you should edit your post, replace the picture with the text it contains. makes the question findable by others.

---

<div class="post-metadata">

**Author:** ![Tamada](https://avatars.discourse-cdn.com/v4/letter/t/5e9695/32.png) [@Tamada](https://forum.opencv.org/u/Tamada)\
**Post date:** [November 14, 2022, 7:17pm UTC](https://forum.opencv.org/t/warning-messages-when-building-opencv-with-opencv-contrib/10953/3 "2022-11-14T19:17:50Z")

</div>

I tried to disable build of: tests, Android projects, Android examples, but I still get warnings(I replaced the photo with just this warnings)

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [November 14, 2022, 8:50pm UTC](https://forum.opencv.org/t/warning-messages-when-building-opencv-with-opencv-contrib/10953/4 "2022-11-14T20:50:15Z")

</div>

ignore the warnings. there are always a ton of warnings when building huge projects. nobody has time to worry about the little things.

in that case, whoever wrote the code probably didn’t worry particularly about value ranges.

you could file an issue about it, unless that already exists.
