Defining a preprocessor directive for windows 7
Defining a preprocessor directive for windows 7
我正在使用SetDllDirectory(),想知道如何为windows 7 HP 64位定义指令
在预处理器指令中:
Add WIN7
在.cpp中,我想添加一些类似的内容
#ifndef WIN7<- where the function is used
SetDllDirectory();
#endif
但一旦我添加了这些语句,SetDllDirectory就会被注释。
这是我尝试过的,我在预处理器定义中添加了WIN7,并添加了:
#if defined(__WIN7__)
if (regkeyExists) {
if (regkey->HasValue("LibPath")) {
regkey->QueryValue("LibPath", value);
if (!value.empty()) {
wxSetEnv("ABCLib", value);
SetDllDirectory(value.c_str());
}
}
}
SetDllDirectory("C:\Program Files\ABC\ABCProject\lib");
#endif
这是申报Windows7 的权利吗
感谢
您不想定义自己的宏来检测Windows7,请使用Microsoft提供的宏-将您的Win7代码封装在:中
#ifdef _WIN32_WINNT_WIN7
xyz()
#endif
如果你真的创建了自己的,那么当你想为Windows 7编译时,你必须定义它,看起来你隐藏了SelDllDirectory()函数——#ifndef的意思是"如果没有定义",所以如果WIN7宏没有在任何地方定义,那么你就得到了这个函数。
NTDDI_VERSION
或_WIN32_WINNT
怎么样?
相关文章:
- 在Linux for Windows上编译C++代码时出错
- 如何在 Linux for Windows 上通过 MinGW 构建静态 ICU 的 Boost
- 如何在 qt for windows 中使用 QAxObject 创建 docx 和 doc 文件?
- SFML 交叉编译 for Windows on Linux.
- 如何在"XAML for Windows Embedded (Compact 2013)"中切换图像
- Build Boost Regex for Windows VS2013
- 在 Windows 10 上安装 tesseract for C++
- 如何交叉编译一个在 Linux for Linux 和 Linux for Windows 中编译的程序?
- Windows Subsystem for Linux (WSL) 下的间歇性随机"找不到文件"错误
- tesseract.lib (version 4 ) for windows 10 (x64)
- Git-Bash for Windows 'rm' 是如何工作的?
- 使用 Visual Studio 2013 编译 GDCM dlls 2.8.4 for Windows
- C++ on Jupyter Notebook for Windows
- OpenGL for Windows 7
- 在 Ubuntu for Windows 上构建 QT5 项目
- 在 Windows for Linux on Intel 上编译C++库
- 我可以在 Windows for Linux 平台中创建应用程序吗?
- 如何在 Windows for Visual Studio 2005 上设置 WXWIDGETS
- 在 Windows for Linux 下编译C++代码,以便运行
- 如何使用gcc在windows for linux上进行跨平台编译