diff --git a/dnn/vec_avx.h b/dnn/vec_avx.h
index f71e01f00b2abe1b3815a6a119a95b3a6b275649..9962284b0c9bfd10ad1d05064995f626c9737f54 100644
--- a/dnn/vec_avx.h
+++ b/dnn/vec_avx.h
@@ -33,6 +33,7 @@
 #define VEC_AVX_H
 
 #include <immintrin.h>
+#include <math.h>
 
 /* Use 8-bit dot products unless disabled or if stuck with SSE2. */
 #if (defined(__AVX2__) || defined(__SSSE3__)) && !defined(DISABLE_DOT_PROD)