felixdoerre / primus_vk

Vulkan GPU-offloading layer
BSD 2-Clause "Simplified" License
230 stars 17 forks source link

cannot build primus_vk with g++ 7 #69

Closed thehug0naut closed 4 years ago

thehug0naut commented 4 years ago

I'm on ubuntu 18.04 and struggling to build primus_vk. I'm getting the following messages when I try to run make:

g++  --std=gnu++11 -g3 -I/usr/include/vulkan -shared -fPIC primus_vk.cpp -o libprimus_vk.so -Wl,-soname,libprimus_vk.so.1 -ldl -lpthread 
primus_vk.cpp: In function ‘VkResult PrimusVK_AcquireNextImageKHR(VkDevice, VkSwapchainKHR, uint64_t, VkSemaphore, VkFence, uint32_t*)’:
primus_vk.cpp:948:3: sorry, unimplemented: non-trivial designated initializers not supported
   };
   ^
primus_vk.cpp:948:3: sorry, unimplemented: non-trivial designated initializers not supported
primus_vk.cpp:948:3: sorry, unimplemented: non-trivial designated initializers not supported
primus_vk.cpp:948:3: sorry, unimplemented: non-trivial designated initializers not supported
Makefile:19: recipe for target 'libprimus_vk.so' failed
make: *** [libprimus_vk.so] Error 1

I made sure to download the version of the vulkan sdk that matched my installed version (1.1.126) but haven't really got any idea what's going wrong at this point.

felixdoerre commented 4 years ago

This is due to the older g++ version. I am developing with a newer g++ version and the designated initializers are not supported in g++ 7. I've re-written the code so that it should compile with g++ 7 now and pushed a commit to master: f84fba6d. Could you please re-test to compile?

As I am not developing or testing with g++ 7, support for that is kind-of best-effort and dependent on issues like this one to keep it working. Thank you for reporting this.

felixdoerre commented 4 years ago

As there is no reaction, I assume that this issue has been resolved. Please feel free to reopen or open a new issue, if the problem persists.

thehug0naut commented 4 years ago

Sorry I hadn't had a chance to build it till today. It seems to have built perfectly, thanks for the fix.