Ask Your Question
0

ACCESS MASK AMBIGUOUS SYMBOL

asked 2015-05-17 15:55:12 -0600

valazom gravatar image

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 flag offensive close merge delete

Comments

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

bear35645 gravatar imagebear35645 ( 2015-06-04 08:21:11 -0600 )edit

3 answers

Sort by ยป oldest newest most voted
1

answered 2015-06-04 08:29:02 -0600

bear35645 gravatar image

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.

edit flag offensive delete link more

Comments

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.

pklab gravatar imagepklab ( 2015-12-19 10:07:27 -0600 )edit

Thank you. This helped.

gosk gravatar imagegosk ( 2017-06-27 07:31:57 -0600 )edit

I know this is old, but adding this in case anyone else gets stuck... Moving the using namespace cv; to the cpp files did not work for me. What did work is making sure that Windows.h ( or in my case, another third party header that included it), when included, is above the cv includes..

antithing gravatar imageantithing ( 2018-07-21 11:24:49 -0600 )edit
0

answered 2018-01-14 06:02:19 -0600

I just moved opencv includes and using namespace cv next to all includes and before functions and main and its solved

edit flag offensive delete link more

Comments

Thanks, it helped. I am using openframeworks, hence moving ofxmain.h to top sorted the issue.

ajonnet gravatar imageajonnet ( 2018-07-14 01:43:24 -0600 )edit
-1

answered 2015-06-04 08:44:31 -0600

valentine gravatar image

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-05-17 15:55:12 -0600

Seen: 21,722 times

Last updated: Jun 04 '15