Compilation error with my c++ project

Hi All,
Any one please help me in resolving this errors. i have compiled the opencv5.8.0. using msbuild visual studio 2017 native command tool after generating project files . I have added headers files in one of my project in below order :

#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/videoio.hpp"
#include "opencv2/opencv.hpp"

but comipilng my project giving below errors. i have no where used any openCV api .


11>f:\elast\opencv-4.8.0\modules\flann\include\opencv2\flann\matrix.h(69): error C2059: syntax error: ',' (compiling source file MultiROIAtom.cpp)
11>f:\elast\opencv-4.8.0\modules\flann\include\opencv2\flann\matrix.h(84): note: see reference to class template instantiation 'cvflann::Matrix<T>' being compiled (compiling source file MultiROIAtom.cpp)
11>f:\elast\opencv-4.8.0\modules\core\include\opencv2\core\cuda.hpp(115): error C2059: syntax error: 'constant' (compiling source file MultiROIAtom.cpp)

I encountered a similar problem when trying to add libraries to find potentioal memory leaks in my project. I added:

#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>

which allows me to use this function to scan for memory leaks:
_CrtDumpMemoryLeaks();

However, this seemed to break my CMake all of a sudden. My guess is that you have a similar problem with a library that’s causing some issue. Try to eliminate them 1 by 1 and see what happens or shift them around.

After moving these includes to the bottom of my include list, it all worked fine again.