I am trying to upgrade my opencv 2.4.11 to opencv 3.0rc1 and i get the following error:

Error   1   error C2872: 'ACCESS_MASK' : ambiguous symbol   C:\Program Files (x86)\Windows Kits\8.1\Include\um\winnt.h  9084


Error 2 error C2872: 'ACCESS_MASK' : ambiguous symbol C:\Program Files (x86)\Windows Kits\8.1\Include\um\winnt.h 9142 Error 3 error C2872: 'ACCESS_MASK' : ambiguous symbol C:\Program Files (x86)\Windows Kits\8.1\Include\um\winnt.h 9143 Error 4 error C2872: 'ACCESS_MASK' : ambiguous symbol C:\Program Files (x86)\Windows Kits\8.1\Include\um\winnt.h 9144

Please can someone help with this.

edit retag close merge delete

I am getting the same error. Did you resolve this?

( 2015-06-04 08:21:11 -0500 )edit

Sort by » oldest newest most voted

I found the answer some place else. The problem is caused by putting "using namespace cv;" in a header. If you need to define a class member that is part of the cv namespace in the header, use cv:: in front of the class name and move the using namespace to your cpp file.

more

1

You're right!. From the complete answerThis was a problem with having using namespace cv in a header, and then including windows headers.

using namespace ... in a header should be discouraged but a workaround for ACCESS_MASK issue could be to include Windows.h stuffs before of OpenCV.

( 2015-12-19 10:07:27 -0500 )edit

Thank you. This helped.

( 2017-06-27 07:31:57 -0500 )edit

A temporary fix is the change all instance in winn.h that has ACCESS_MASK to FIX_ME_ACCESS_MASK. This has worked fine for me so far. The only hassle is if any of your project references winn.h you gets bugs. other than that you are good to go.

more