error C2039: “SetDefaultDllDirectories”:is not a member of global namespace(错误 C2039:“SetDefaultDllDirectories:不是全局命名空间的成员)
问题描述
xxxvcatlmfcincludeatlcore.h(638):错误 C2039:SetDefaultDllDirectories":不是全局命名空间"的成员
xxxvcatlmfcincludeatlcore.h(638): error C2039: "SetDefaultDllDirectories": is not a member of "global namespace"
#ifndef _USING_V110_SDK71_
// the LOAD_LIBRARY_SEARCH_SYSTEM32 flag for LoadLibraryExW is only supported if the DLL-preload fixes are installed, so
// use LoadLibraryExW only if SetDefaultDllDirectories is available (only on Win8, or with KB2533623 on Vista and Win7)...
IFDYNAMICGETCACHEDFUNCTION(L"kernel32.dll", SetDefaultDllDirectories, pfSetDefaultDllDirectories)
{
return(::LoadLibraryExW(pszLibrary, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32));
}
#endif
里面的功能都是VS没有实现的
那么我该如何解决这个问题呢?
libray有什么问题吗?我在VS2012中运行这个程序
the functions in it are all not realized by VS
so how do I solve this problem?
is there something wrong with the libray?I run this program in VS2012
推荐答案
您必须确保在您的项目属性中定义了_USING_V110_SDK71_".Visual Studio 会自动为您定义.它通常不会显示",因为未勾选从父级或项目默认值继承".
You have to make sure "_USING_V110_SDK71_" is defined in your project properties. Visual Studio automatically defines this for you. It normally doesn't "show up" because "Inherit from parent or project defaults" is un-ticked.
从旧的 atl 项目升级时,我发现这种情况很常见,因为某些原因,stdafx.cpp 未勾选从父级或项目默认值继承".
I've found this common when upgrade from old atl projects that the stdafx.cpp has "Inherit from parent or project defaults" un-ticked for some reason.
您应该检查项目设置以及单个 stdafx.cpp 文件设置,以确定在预处理器定义中选中了从父级或项目默认值继承"复选框.在某些情况下,会检查项目文件的预处理器定义对话框,但不会检查特定 stdafx.cpp 文件的预处理器定义对话框.
You should check both the project settings as well as the individual stdafx.cpp file settings to determine that in the Preprocessor Definitions the "Inherit from parent or project defaults" check box is checked. In some cases the Preprocessor Definitions dialog of the Project file is checked however the Preprocessor Definitions dialog of the specific stdafx.cpp file is NOT checked.
这篇关于错误 C2039:“SetDefaultDllDirectories":不是全局命名空间的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:错误 C2039:“SetDefaultDllDirectories":不是全局命名空间的成员
基础教程推荐
- 初始化列表*参数*评估顺序 2021-01-01
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
- CString 到 char* 2021-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
