包括 secExt.h 会导致错误 [英] including secExt.h causes errors

查看:34
本文介绍了包括 secExt.h 会导致错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在我的 C++ 项目中包含 secExt.h 并且它给了我错误:

I'm trying to include secExt.h in my C++ project and it gives me the error:

错误 C2086:'BOOLEAN SEC_ENTRY':重新定义

error C2086: 'BOOLEAN SEC_ENTRY' : redefinition

我该如何解决?

推荐答案

EDIT:来自 microsoft 的文档,包括 security.h,不是 [secext.h].

EDIT: from microsoft's docs, include security.h, not [secext.h].

原始答案(在我自己搜索标题名称之前,OP 未提供任何信息):

original answer (before I googled the header name myself, no info given by OP):

如果标题是您的,请添加

if the header is yours, add

#pragma once

在顶部.

如果这不起作用(据说在某些 IBM 系统上有一个编译器或不支持 #pragma once 的东西),然后使用头保护.

if that doesn't work (there is reportedly a compiler on some IBM system or something that doesn't support #pragma once), then use a header guard.

如果标题不是你的,创建一个像这样的标题包装器:

if the header isn't yours, create a header wrapper like this:

#pragma once
#include <secExt.h>

然后包含您的包装器标头,而不是直接包含 [secExt.h].

then include your wrapper header instead of including [secExt.h] directly.

这篇关于包括 secExt.h 会导致错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆