解决“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)

相关文章
|
12月前
|
数据安全/隐私保护
cross-region access is not allowed
cross-region access is not allowed
133 1
HALCON error #1302: Wrong value of control parameter: 2 in operator affine_trans_region
HALCON error #1302: Wrong value of control parameter: 2 in operator affine_trans_region
|
12月前
|
算法 C# C++
HALCON error #1201: Wrong type of control parameter: 1 in operator threshold
HALCON error #1201: Wrong type of control parameter: 1 in operator threshold
|
1月前
|
网络安全
出现“Host key verification failed”错误--解决
遇到“Host key verification failed”错误,通常是因为远程主机密钥发生变化,与本地保存的信息不符。这种情况可能是远程主机系统更改或重装等原因导致的。解决方法是根据提示使用`ssh-keygen -f "/root/.ssh/known_hosts" -R "[10.61.0.152]:29022"`命令移除旧的密钥信息,然后重新尝试连接。
78 5
|
5月前
|
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, 此行为已弃用
|
网络虚拟化
使用ChatGPT Access denied,Error reference number: 1020问题解决
使用ChatGPT Access denied,Error reference number: 1020问题解决
使用ChatGPT Access denied,Error reference number: 1020问题解决
|
Java Maven Android开发
Maven项目报错invalid LOC header (bad signature)
Maven项目报错invalid LOC header (bad signature)
144 0
Maven项目报错invalid LOC header (bad signature)
|
Java Android开发
is not allowed for source level below 1.7 的解决办法
is not allowed for source level below 1.7 的解决办法
179 0
|
Java Maven
invalid LOC header (bad signature) 错误解决办法
invalid LOC header (bad signature) 错误解决办法
637 0
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
545 1