Lots of errors from 'imgproc.hpp' when trying to build. (OpenCV 4.9.0)

1>main.cpp
1>C:\opencv\build\include\opencv2\imgproc.hpp(4956,27): error C2589: ‘(’: illegal token on right side of ‘::’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4956,22): error C2144: syntax error: ‘unknown-type’ should be preceded by ‘)’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4956,9): error C2660: ‘cv::LineIterator::init’: function does not take 2 arguments
1>C:\opencv\build\include\opencv2\imgproc.hpp(4956,22): error C2144: syntax error: ‘unknown-type’ should be preceded by ‘;’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4956,27): error C2143: syntax error: missing ‘)’ before ‘.’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4956,27): error C3928: ‘->’: trailing return type is not allowed after a parenthesized declarator
1>C:\opencv\build\include\opencv2\imgproc.hpp(4956,27): error C3484: syntax error: expected ‘->’ before the return type
1>C:\opencv\build\include\opencv2\imgproc.hpp(4956,27): error C3613: missing return type after ‘->’ (‘int’ assumed)
1>C:\opencv\build\include\opencv2\imgproc.hpp(4956,27): error C2082: redefinition of formal parameter ‘pt1’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4956,27): error C2146: syntax error: missing ‘;’ before identifier ‘x’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4956,27): error C2059: syntax error: ‘)’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4956,27): error C2065: ‘x’: undeclared identifier
1>C:\opencv\build\include\opencv2\imgproc.hpp(4957,27): error C2589: ‘(’: illegal token on right side of ‘::’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4957,22): error C2062: type ‘unknown-type’ unexpected
1>C:\opencv\build\include\opencv2\imgproc.hpp(4957,27): error C2059: syntax error: ‘)’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4958,27): error C2589: ‘(’: illegal token on right side of ‘::’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4958,27): error C2059: syntax error: ‘)’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4958,52): error C2589: ‘(’: illegal token on right side of ‘::’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4958,52): error C2059: syntax error: ‘)’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4959,27): error C2589: ‘(’: illegal token on right side of ‘::’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4959,27): error C2059: syntax error: ‘)’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4959,52): error C2589: ‘(’: illegal token on right side of ‘::’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4959,52): error C2059: syntax error: ‘)’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4959,73): error C2059: syntax error: ‘)’
1>C:\opencv\build\include\opencv2\imgproc.hpp(4960,49): error C2059: syntax error: ‘)’
1>Done building project “clrbt.vcxproj” – FAILED.

I followed a tutorial from YouTube for the setup: https://www.youtube.com/watch?v=YUjamcyuKT4

My project’s properties:
Include directories: C:\opencv\build\include
Library directories: C:\opencv\build\x64\vc16\lib
Linker - Input - Additional Dependencies - opencv_world490.lib; opencv_world490d.lib

I also added:
C:\opencv\build\x64\vc16\lib
C:\opencv\build\x64\vc16\bin
To my environmental variables’ path.