EQMG/Acid

Compile bug on linux

EduardoLemos567 opened this issue · 4 comments

Describe the bug
While compiling on cmake got this error:
/Acid/Sources/Devices/LogicalDevice.cpp:87:20: error: cannot convert ‘std::nullptr_t’ to ‘uint32_t’ {aka ‘unsigned int’} in assignment 87 | graphicsFamily = VK_NULL_HANDLE;

Changed VK_NULL_HANDLE to 0 on line 87, i dont know if its correct, but its compiling without any other errors.

To Reproduce
Installed all linux required libs, run cmake-gui, configure and generate then call make in the folder.

Expected behaviour
Compilation without errors.

Hardware:

  • Device: Notebook Asus, core i5 3317u, nvidia geforce 740m, 6gb ram
  • OS: Ubuntu 20.04

Additional context
Sorry if anything is incorrect, i'm a complete noob on C++ compile tools, first time using cmake.

I've been building on Vulkan SDK 1.2.154.1, updating to the latest 1.2.176.0 I can see VK_NULL_HANDLE has changed definitions. Before it was always defined as zero, now on C++ x64 it is defined as nullptr.
d20ded6 should work as a fix for this build error.

Now i got this error:
/Acid/Sources/Devices/LogicalDevice.cpp:87:30: error: cast from ‘std::nullptr_t’ to ‘uint32_t’ {aka ‘unsigned int’} loses precision [-fpermissive] 87 | graphicsFamily = (uint32_t)VK_NULL_HANDLE;

I only tested the change in MSVC, looks to be another case where Microsoft ignored the standard. GCC, Clang, and the standard say nullptr cannot be cast to an int. So yes setting the variable to 0 appears to be the simplest solution. 0a91f72

Thanks for this.