Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile Error in vk_mem_alloc.h with VS2019 #36

Open
kobutri opened this issue May 15, 2021 · 5 comments
Open

Compile Error in vk_mem_alloc.h with VS2019 #36

kobutri opened this issue May 15, 2021 · 5 comments

Comments

@kobutri
Copy link

kobutri commented May 15, 2021

I downloaded the all-chapters branch configured the project with CMake for VS2019 and then set chapter 3 as startup project.
When trying
to compile I get a bunch of errors in vk_mem_alloc.h

image

@cdgiessen
Copy link
Contributor

From monkeying about with the code, I seems to be due to some incompatibility between SDL and VMA. If you move the VMA include in vk_engine.cpp to be above the SDL include, it works.

Works

#define VMA_IMPLEMENTATION
#include "vk_mem_alloc.h"

#include <SDL.h>
#include <SDL_vulkan.h>

Fails with the errors above.

#include <SDL.h>
#include <SDL_vulkan.h>

#define VMA_IMPLEMENTATION
#include "vk_mem_alloc.h"

I'd need to investigate it more as to why its causing that, but at least this fix should allow you to continue working with the tutorial.

@kobutri
Copy link
Author

kobutri commented May 15, 2021

Thank you so much.

@zheng95z
Copy link

The same issue, looking forward to seeing why.

@Harold2017
Copy link

I thought the problem is about the std::shared_mutex in VMA by a glance of the error msg, then add set(CMAKE_CXX_STANDARD 17) in CMakeList to force MSVC use 17 standard for compiling, and it works well. But it really confused me by way of swapping vma header with sdl...

@OptimisticMonkey
Copy link

Thanks for posting - this fixed it for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants