Repository navigation
Closed
Description
System information (version)
- OpenCV => master 7267e94
- Operating System / Platform => Ubuntu 17.10
- Compiler => g++-5 (5.5.0-1ubuntu1)
Detailed description
While building OpenCV I got this error:
[ 78%] Building CXX object modules/photo/CMakeFiles/opencv_photo.dir/src/denoising.cpp.o
In file included from opencv/modules/photo/src/fast_nlmeans_denoising_invoker.hpp:48:0,
from opencv/modules/photo/src/denoising.cpp:44:
opencv/modules/photo/src/fast_nlmeans_denoising_invoker_commons.hpp: In static member function ‘static WT DistAbs::calcWeight_<T, WT>::f(double, const float*, WT)’:
opencv/modules/photo/src/fast_nlmeans_denoising_invoker_commons.hpp:138:17: error: ‘__builtin_isnan’ is not a member of ‘std’
if (std::isnan(w)) w = 1.0; // Handle h = 0.0
^
opencv/modules/photo/src/fast_nlmeans_denoising_invoker_commons.hpp:138:17: note: suggested alternative:
<built-in>: note: ‘__builtin_isnan’
opencv/modules/photo/src/fast_nlmeans_denoising_invoker_commons.hpp: In static member function ‘static WT DistSquared::calcWeight_<T, WT>::f(double, const float*, WT)’:
opencv/modules/photo/src/fast_nlmeans_denoising_invoker_commons.hpp:260:17: error: ‘__builtin_isnan’ is not a member of ‘std’
if (std::isnan(w)) w = 1.0; // Handle h = 0.0
^
opencv/modules/photo/src/fast_nlmeans_denoising_invoker_commons.hpp:260:17: note: suggested alternative:
<built-in>: note: ‘__builtin_isnan’
modules/photo/CMakeFiles/opencv_photo.dir/build.make:427: recipe for target 'modules/photo/CMakeFiles/opencv_photo.dir/src/denoising.cpp.o' failed
make[2]: *** [modules/photo/CMakeFiles/opencv_photo.dir/src/denoising.cpp.o] Error 1
CMakeFiles/Makefile2:3602: recipe for target 'modules/photo/CMakeFiles/opencv_photo.dir/all' failed
make[1]: *** [modules/photo/CMakeFiles/opencv_photo.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Steps to reproduce
export CC=/usr/bin/gcc-5
export CXX=/usr/bin/g++-5
cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..
I have replaced std::isnan( with cvIsNaN( and built it without errors. Do you have any suggestions how to build it without modifying the source code?
Activity
alalek commentedon Nov 6, 2017
There is no such problem with other versions of GCC (4.8.4 / 5.3 / 7.2.1).
Consider to report this regression to GCC team: https://gcc.gnu.org/bugzilla (they may ask for additional information).
Ubuntu 17.10 ships GCC 7.x by default - probably there is a problem in your build environment via mixing of incompatible libstdc/stdc++ headers.
BTW, "google" suggests to add
#include <cmath>somewhere.johalaoui commentedon Nov 7, 2017
This issue was very similar to this one: https://github.com/voidlinux/void-packages/issues/7324#issuecomment-321241340
I have changed c++config.h and built it without errors.
eguoguo321 commentedon Jan 17, 2020
Thank U VERY MUCH,IT troubles me a lot fo time
fix ffmpeg (libaom) in newer gcc versions
fix ffmpeg (libaom) in newer gcc versions
fix ffmpeg (libaom) in newer gcc versions
fix ffmpeg (libaom) in newer gcc versions
fix ffmpeg (libaom) in newer gcc versions
fix ffmpeg (libaom) in newer gcc versions
fix ffmpeg (libaom) in newer gcc versions
fix ffmpeg (libaom) in newer gcc versions
[ffmpeg] vaapi access
[ffmpeg] vaapi access
[ffmpeg] vaapi access
[ffmpeg] vaapi access
[ffmpeg] vaapi access
[ffmpeg] vaapi access
[ffmpeg] vaapi access
[ffmpeg] vaapi access
[ffmpeg] vaapi access
[ffmpeg] vaapi access
Fix Tvheadend and ffmpeg for DMS 7 (#4545)
Fix Tvheadend and ffmpeg for DMS 7 (SynoCommunity#4545)