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

相关文章
|
IDE PyTorch 网络安全
|
算法 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
|
8月前
|
数据可视化
Open3d Point cloud outlier removal 点云异常值移除
Open3d Point cloud outlier removal 点云异常值移除
190 1
解决 Blocked a frame with origin “xxx“ from accessing a cross-origin frame
解决 Blocked a frame with origin “xxx“ from accessing a cross-origin frame
4052 0
|
9月前
|
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问题解决
|
JavaScript 前端开发 应用服务中间件
【已解决】“Content-Security-Policy”头缺失
【已解决】“Content-Security-Policy”头缺失
3224 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
676 1
|
Linux
解决checkPermissions Missing write access to
解决checkPermissions Missing write access to
334 0