我在我编写的代码之一中使用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/