g++ -gdwarf-2 -shared -O2 -fPIC -std=gnu++11 layer.cpp -o libVkLayer_device_chooser.so
layer.cpp: In function ‘VkResult ChooseDevice(VkInstance, const VkLayerInstanceDispatchTable&, const char*, VkPhysicalDevice_T*&)’:
layer.cpp:65:23: error: ‘atoi’ was not declared in this scope
65 | int deviceIndex = atoi(env);
| ^~~~
layer.cpp: In function ‘VkResult DeviceChooserLayer_EnumeratePhysicalDevices(VkInstance, uint32_t*, VkPhysicalDevice_T**)’:
layer.cpp:88:29: error: ‘getenv’ was not declared in this scope
88 | const char* const env = getenv(kEnvVariable);
| ^~~~~~
layer.cpp: In function ‘VkResult DeviceChooserLayer_EnumeratePhysicalDeviceGroupsKHR(VkInstance, uint32_t*, VkPhysicalDeviceGroupPropertiesKHR*)’:
layer.cpp:125:29: error: ‘getenv’ was not declared in this scope
125 | const char* const env = getenv(kEnvVariable);
| ^~~~~~
make: *** [Makefile:4: libVkLayer_device_chooser.so] Error 1
==> ERROR: A failure occurred in build().
Aborting...
Error making: vkdevicechooser
When installing from aur:
Arch Linux Kernel 5.7 Mesa-20.1.0