c++ - SetDllDirectory在此范围内未声明-Netbeans 7.1

标签 c++ compiler-errors setdlldirectory

我在我编写的代码之一中使用SetDllDirectory(),但是在编译项目时出现以下错误:

SetDllDirectory was not declared in this scope

这是代码片段
void LoadDLLPath() {
wxString value;
if (regkeyExists) {
    if (regkey->HasValue("LibPath")) {
        regkey->QueryValue("LibPath", value);
        if (!value.empty()) {
            wxSetEnv("ImpressionLib", value);
            SetDllDirectory(value.c_str());
        }
    }

}
SetDllDirectory("C:\\Program Files\\Project\\ABCPROJECT\\lib");
wxSetEnv("ProjectPath", "C:\\Program Files\\Project\\ABCPROJECT\\lib");

}

最佳答案

预处理程序常量_WIN32_WINNT的值是多少?它在文件WinBase.h中定义,该文件可能会提供一些信息。

有关SetDllDirectory(https://msdn.microsoft.com/en-us/library/windows/desktop/ms686203%28v=vs.85%29.aspx)的Microsoft文档说:

To compile an application that uses this function, define _WIN32_WINNT as 0x0502 

使用Visual Studio,还应该检查项目属性“平台工具集”是否设置为最小值“v100”。

关于c++ - SetDllDirectory在此范围内未声明-Netbeans 7.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12049335/

相关文章:

c++ - 通过引用传递自定义优先级队列

c++ - 为 boost::iterator_adapter 设置 iterator_bracket_proxy

c++ - 由于滥用 MQTTAsync_connectOptions,paho cpp 客户端无法编译

c++ - Mac OSX Yosemite 上的编译器 (Apple LLVM 7.0) 无法识别父类成员变量

c++ - boost::spirit::qi 编译器错误:没有转换运算符无法将 'const some_stuff::return_type' 转换为 'unsigned int'

dll - 添加自定义 DLL 搜索路径@应用程序启动

C++ 列表拼接帮助

c++ - 从另一个进程调用 SetDllDirectory 不起作用?

c++ - 调用 "SetDllDirectory"时表达式: string iterators incompatiable,

c++ - 显示所有变量共有的值