Keywords: UE4, error C4002 too many arguments for function-like macro invocation ‘check’

Error 1st at building project:

D:\MyProj\ThirdParty\OpenCV\Includes\opencv2\core\cvstd_wrapper.hpp(45): error C4002: too many arguments for function-like macro invocation 'check'
D:\MyProj\ThirdParty\OpenCV\Includes\opencv2\core\cvstd_wrapper.hpp(45): error C2988: unrecognizable template declaration/definition
D:\MyProj\ThirdParty\OpenCV\Includes\opencv2\core\cvstd_wrapper.hpp(58): note: see reference to class template instantiation 'cv::sfinae::has_parenthesis_operator<C,Ret,Args...>' being compiled
D:\MyProj\ThirdParty\OpenCV\Includes\opencv2\core\cvstd_wrapper.hpp(45): error C2059: syntax error: '<end Parse>'
D:\MyProj\ThirdParty\OpenCV\Includes\opencv2\core\cvstd_wrapper.hpp(45): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
D:\MyProj\ThirdParty\OpenCV\Includes\opencv2\core\cvstd_wrapper.hpp(47): error C2988: unrecognizable template declaration/definition
D:\MyProj\ThirdParty\OpenCV\Includes\opencv2\core\cvstd_wrapper.hpp(47): error C2059: syntax error: '<end Parse>'
D:\MyProj\ThirdParty\OpenCV\Includes\opencv2\core\cvstd_wrapper.hpp(47): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
D:\MyProj\ThirdParty\OpenCV\Includes\opencv2/core/types.hpp(2419): warning C4946: reinterpret_cast used between related classes: 'cv::Matx<double,4,1>' and 'cv::Scalar_<double>'
D:\MyProj\ThirdParty\OpenCV\Includes\opencv2/core/matx.hpp(226): note: see declaration of 'cv::Matx<double,4,1>'
D:\MyProj\ThirdParty\OpenCV\Includes\opencv2/core/types.hpp(669): note: see declaration of 'cv::Scalar_<double>'
D:\MyProj\ThirdParty\OpenCV\Includes\opencv2/core/utility.hpp(53): fatal error C1021: invalid preprocessor command 'warning'

Error 2nd at building project:

D:\MyProj\ThirdParty\OpenCV\Includes\opencv2/core/utility.hpp(977): error C4003: not enough arguments for function-like macro invocation 'check'
D:\MyProj\ThirdParty\OpenCV\Includes\opencv2/core/utility.hpp(977): error C4003: not enough arguments for function-like macro invocation 'UE_CHECK_IMPL'
D:\MyProj\ThirdParty\OpenCV\Includes\opencv2/core/utility.hpp(977): error C2062: type 'bool' unexpected
D:\MyProj\ThirdParty\OpenCV\Includes\opencv2/core/utility.hpp(977): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
D:\MyProj\ThirdParty\OpenCV\Includes\opencv2/core/utility.hpp(977): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
D:\MyProj\ThirdParty\OpenCV\Includes\opencv2/core/utility.hpp(977): error C2208: 'const int': no members defined using this type

Caused by:
Third party libiary contains function check(), it would be shadowed by a macro check named as UE_CHECK_IMPL which implemented in UE4.

Solution:
Rename the function check() in third party library source and rebuild it.


“...time was not passing...it was turning in a circle..." ― Gabriel García Márquez, One Hundred Years of Solitude