Visual studio doesn't want to resolve a system variable.
In Computer>Properties>Advanced>Environment Variables
variable VULKAN_SDK
is set to C:\VulkanSDK\1.2.131.2
.
However, if I go to Project>Properties>C/C++
setting Additional Include Directories
is set to %VULKAN_SDK%\Include;(...)
. If I open this field for editing, I can see that the line resolves to %VULKAN_SDK%\Include
instead of C:\VulkanSDK\1.2.131.2\Include
.
It worked until I installed a new version of VulkanSDK.
Note that I closed all VS instances, uninstalled two previous SDKs I had installed (the variable resolved to the latest until then), restarted the PC, installed the new SDK, restarted the PC again and then started VS.
System variable appeared as soon as I installed the new SDK, so that last restart was probably pointless.
Is there any way to force Visual Studio to reevaluate system variables? I was hopping it was something it did automatically, but I don't know anymore.
Any ideas?
Answer provided by Hans Passant in a comment:
%VULKAN_SDK% is expanded by the command processor, useful only in a build event. In VS you need to use
$(VULKAN_SDK)
.
I don't and obviously can't claim credit for Hans' solution, but comments are more vulnerable than answers and this way the question can be properly closed. Perhaps the question will also be more useful then, since some won't even open the question when they see it has 0 answers as opposed to 1 (accepted) answer.