Ask Your Question

Ambiguous symbol error with Windows 8 SDK and OPENCV

asked 2013-11-06 02:00:13 -0600

ice031 gravatar image

Hello, I've been trying to compile opencv using vs2012 on Windows 8 and using the master build from OPENCV GITHUB. When I'm building it, I get the following errors:

------ Build started: Project: opencv_traincascade, Configuration: Debug Win32 ------ 9> boost.cpp 9>C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(8534): error C2872: 'ACCESS_MASK' : ambiguous symbol 9> could be 'C:\Program Files (x86)\Windows Kits\8.0\Include\um\winnt.h(8533) : DWORD ACCESS_MASK' 9> or 'D:\Development\opencv_working\modules\core\include\opencv2/core/mat.hpp(59) : ACCESS_MASK'

This is just one of the many ambiguous errors i'm getting for ACCESS_MASK.

Is there any solution or fix to this problem?


edit retag flag offensive close merge delete


Same issue on Win 8.1 RTM. opencv_traincascade is the only project that fails with the above conflict. I get 42 build errors on that project, though. I cloned the trunk of the opencv repo yesterday (Nov 6 2013). If there is indeed a conflict between Windows Kits and mat.hpp, this could be a nuisance whenever we need to use mat.hpp. Would be good to have a clarification from anyone in the know.

matthai gravatar imagematthai ( 2013-11-07 13:49:25 -0600 )edit

2 answers

Sort by ยป oldest newest most voted

answered 2013-11-11 04:29:36 -0600

Leszek gravatar image

This was a problem with having using namespace cv in a a header, and then including windows headers. This pulled cv::ACCESS_MASK into global scope where it clashed with the already global Windows-defined ACCESS_MASK.

I've fixed this and submitted a PR:

edit flag offensive delete link more


Thank you for PR!

Daniil Osokin gravatar imageDaniil Osokin ( 2013-11-11 04:41:27 -0600 )edit

answered 2016-08-10 03:36:38 -0600

Hi, I still want to use "using namespace cv". So, Is there any other way to deal with this problem?

edit flag offensive delete link more


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

sinamcr7 gravatar imagesinamcr7 ( 2018-01-14 06:02:58 -0600 )edit

Question Tools

1 follower


Asked: 2013-11-06 02:00:13 -0600

Seen: 9,401 times

Last updated: Nov 11 '13