Vulkan build problem (error log included) #1325

Closed
acterhd opened this Issue Feb 22, 2016 · 7 comments

Projects

None yet

5 participants

@acterhd
acterhd commented Feb 22, 2016

I can't answer in previous issue, I'm slept.

Hello. I tried build both version of Cinder: Original and Vulkan. With original no problems with compilation. But with Vulkan have errors "uint32_t - int32_t", or "const int".

default

Log in Russian. 7 errors, 137 warnings (not showed).
Tool: Visual Studio 2015.

@chaoticbob
Collaborator

The error messages that you're sending do not provide any details on the problem. Both VS2013 and VS2015 are known to work. Can you send post a screenshot or a gist of the Output window?

@acterhd
acterhd commented Feb 22, 2016
1>------ Сборка начата: проект: cinder, Конфигурация: Release x64 ------
1>  Image.cpp
1>  Presenter.cpp
1>  Swapchain.cpp
1>..\src\cinder\vk\Swapchain.cpp(56): error C2397: преобразование из "const int" в "uint32_t" требует сужающего преобразования
1>..\src\cinder\vk\Image.cpp(62): error C2397: преобразование из "int32_t" в "uint32_t" требует сужающего преобразования
1>..\src\cinder\vk\Image.cpp(72): error C2397: преобразование из "int32_t" в "uint32_t" требует сужающего преобразования
1>..\src\cinder\vk\Image.cpp(85): error C2397: преобразование из "int32_t" в "uint32_t" требует сужающего преобразования
1>..\src\cinder\vk\Image.cpp(98): error C2397: преобразование из "int32_t" в "uint32_t" требует сужающего преобразования
1>..\src\cinder\vk\Image.cpp(678): error C2397: преобразование из "int32_t" в "uint32_t" требует сужающего преобразования
1>..\src\cinder\vk\Presenter.cpp(87): error C2397: преобразование из "int" в "uint32_t" требует сужающего преобразования
1>..\src\cinder\vk\Presenter.cpp(100): warning C4018: >: несоответствие типов со знаком и без знака
1>..\src\cinder\vk\Presenter.cpp(240): warning C4244: аргумент: преобразование "const uint32_t" в "float", возможна потеря данных
1>..\src\cinder\vk\Presenter.cpp(240): warning C4244: аргумент: преобразование "const int32_t" в "float", возможна потеря данных
========== Сборка: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========

Recompile error.

@ilzxc
ilzxc commented Feb 22, 2016

I'm certain you can tell from the errors but as a Russian speaking Cinder user I can verify those are all "missing explicit cast" errors.

Just in case. :)

On Feb 22, 2016, at 1:23 PM, acterhd notifications@github.com wrote:

1>------ Сборка начата: проект: cinder, Конфигурация: Release x64 ------
1> Image.cpp
1> Presenter.cpp
1> Swapchain.cpp
1>..\src\cinder\vk\Swapchain.cpp(56): error C2397: преобразование из "const int" в "uint32_t" требует сужающего преобразования
1>..\src\cinder\vk\Image.cpp(62): error C2397: преобразование из "int32_t" в "uint32_t" требует сужающего преобразования
1>..\src\cinder\vk\Image.cpp(72): error C2397: преобразование из "int32_t" в "uint32_t" требует сужающего преобразования
1>..\src\cinder\vk\Image.cpp(85): error C2397: преобразование из "int32_t" в "uint32_t" требует сужающего преобразования
1>..\src\cinder\vk\Image.cpp(98): error C2397: преобразование из "int32_t" в "uint32_t" требует сужающего преобразования
1>..\src\cinder\vk\Image.cpp(678): error C2397: преобразование из "int32_t" в "uint32_t" требует сужающего преобразования
1>..\src\cinder\vk\Presenter.cpp(87): error C2397: преобразование из "int" в "uint32_t" требует сужающего преобразования
1>..\src\cinder\vk\Presenter.cpp(100): warning C4018: >: несоответствие типов со знаком и без знака
1>..\src\cinder\vk\Presenter.cpp(240): warning C4244: аргумент: преобразование "const uint32_t" в "float", возможна потеря данных
1>..\src\cinder\vk\Presenter.cpp(240): warning C4244: аргумент: преобразование "const int32_t" в "float", возможна потеря данных
========== Сборка: успешно: 0, с ошибками: 1, без изменений: 0, пропущено: 0 ==========
Recompile error.


Reply to this email directly or view it on GitHub.

@lucasvickers
Contributor

It seems like you may have enabled warnings as errors on your project. Did you adjust any settings before trying to compile?

@acterhd
acterhd commented Feb 23, 2016
@richardeakin
Collaborator

I'm not sure what the compiler differences are between what's been tested and what @acterhd is trying on (any information here would help), but it seems to be happening where uniform initialization is used with VK C types. I know there were some bugs around this with vc120, but wasn't aware that vc140 is finicky about it too. In any event it seems reasonable to explicitly do the conversion from int (size.x, size.y) -> uint32_t for those as it will prevent compiler warnings anyway.

Here's one stackoverflow post that indicates this actually does create an error with VC++. Again, not sure why it works in some places but not others.

@chaoticbob
Collaborator

Was finally able to reproduce this. This error seems to occur if one opens the project with VS 2015 and when prompted to upgrade, one proceeds to click Upgrade. This error does not seem to occur if one opens the project and subsequently changes the the compiler version from 120 to 140. I've updated the int32_t to uint32_t conversions on the files that were throwing this error.

Fixed here: c928175.

@ilzxc Thanks for pointing this out. I used Google translate to translate the error messages and saw that it was a narrowing conversion error and figured out what happened.

@chaoticbob chaoticbob closed this Feb 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment