首页 > 解决方案 > 关于程序导出变量

问题描述

显卡厂商有优化方案。以下变量是从程序中导出的,程序会在独立显卡上执行。对于新版bcc编译器编译的程序,导出的变量带有下划线前缀,-vu不支持参数。我不知道如何解决这个问题。

// http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
// The following line is to favor the high performance NVIDIA GPU if there are multiple GPUs
// Has to be .exe module to be correctly detected.
extern "C" __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;

// And the AMD equivalent
// Also has to be .exe module to be correctly detected.
extern "C" __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 0x00000001;

bcc32 旧版本

图片

bcc32c 新版本

图片

标签: c++builderdllexportdeclspec

解决方案


推荐阅读