aejsmith / vkdevicechooser

Vulkan layer to force a specific device to be used
MIT License
77 stars 18 forks source link

Compile error #5

Closed juanro49 closed 4 years ago

juanro49 commented 4 years ago

Hi, I download this tool and i have error when I try "make install"

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

juanro49 commented 4 years ago

Solved, I downgrade gcc and g++ from version 10 to 9 and compile fine!