解决“ACCESS_MASK不明确”错误

简介: 本文讨论了在编译过程中遇到的“ACCESS_MASK不明确”错误的原因和解决方法。错误通常由头文件冲突引起,解决方法包括去除自定义的命名空间、调整包含static函数的类头文件顺序,以及去除多余的#include指令。文章还提供了一些编程规范和参考链接。

一 原因

1、造成“ACCESS_MASK不明确”错误的头文件:

#include "dcmtk/dcmdata/dctk.h"

#include "dcmtk/dcmimgle/dcmimage.h"

#include "dcmtk/dcmjpeg/djdecode.h"

2、引用的类中有static函数

3、有多余的#include

二 解决方法

1、去除自定义的命名空间

2、将引用的含static函数的类头文件顺序放在首位

3、去除多余的#include ,比如calibGlobal.h内有#include

//Error C2872 'ACCESS_MASK': ambiguous symbol

一个合理的符合谷歌编程规范的头文件包含顺序:

#include <QObject>

#include <QDebug>

#include <QDateTime>

#include <QDir>

#include <iostream>

#include <algorithm>

#include <Eigen/Dense> //Include Eigen's headers first. See https://github.com/opencv/opencv/issues/17366"

#include <opencv2/opencv.hpp>

#include <opencv2/core/eigen.hpp>

#include <opencv2/imgproc.hpp>

三 参考链接

求教:ACCESS_MASK如何解析,望有解析过的朋友不吝赐教-CSDN社区

Access Mask - Windows drivers | Microsoft Learn

ACCESS_MASK (Winnt.h) - Win32 apps | Microsoft Learn

(164条消息) Qt ‘ACCESS_MASK‘ is ambiguous typedef ACCESS_MASK *PACCESS_MASK;_麻衣学姐的原配男友的博客-CSDN博客

Qt开发代码编码规范 - 知乎 (zhihu.com)

Google 开源项目风格指南——中文版 — Google 开源项目风格指南 (zh-google-styleguide.readthedocs.io)

相关文章
|
2月前
|
存储 容器
内存越界访问(Out-of-Bounds Access)
【10月更文挑战第12天】
253 2
|
3月前
|
缓存 监控 数据可视化
DAMON: Data Access MONitor 【ChatGPT】
DAMON: Data Access MONitor 【ChatGPT】
|
7月前
|
JavaScript 前端开发
has been blocked by CORS policy: The ‘Access-Control-Allow-Origin‘ header contains multiple values ‘
has been blocked by CORS policy: The ‘Access-Control-Allow-Origin‘ header contains multiple values ‘
169 0
|
7月前
runtime error: member access within misaligned address(力扣最常见错误之一)
runtime error: member access within misaligned address(力扣最常见错误之一)
355 0
解决 Blocked a frame with origin “xxx“ from accessing a cross-origin frame
解决 Blocked a frame with origin “xxx“ from accessing a cross-origin frame
3737 0
|
7月前
|
C++
c++ - 警告 : treating ‘c-header‘ input as ‘c++-header‘ when in C++ mode, 此行为已弃用
c++ - 警告 : treating ‘c-header‘ input as ‘c++-header‘ when in C++ mode, 此行为已弃用
|
API Windows
Qt-解决异常报错“QAxBase::setControl: requested control XXX could not be instantiated”
Qt-解决异常报错“QAxBase::setControl: requested control XXX could not be instantiated”
342 0
|
网络虚拟化
使用ChatGPT Access denied,Error reference number: 1020问题解决
使用ChatGPT Access denied,Error reference number: 1020问题解决
使用ChatGPT Access denied,Error reference number: 1020问题解决
When allowCredentials is true, allowedOrigins cannot contain the special value ___ since that cannot be set on the _Access-Contr
When allowCredentials is true, allowedOrigins cannot contain the special value ___ since that cannot be set on the _Access-Contr
653 1
|
Linux
解决checkPermissions Missing write access to
解决checkPermissions Missing write access to
313 0
下一篇
DataWorks