aws / lumberyard

Amazon Lumberyard is a free AAA game engine deeply integrated with AWS and Twitch – with full source.
Other
2.02k stars 539 forks source link

Compile Error - LocalFileIO #553

Open ratchet3789 opened 3 years ago

ratchet3789 commented 3 years ago

Describe the bug Project fails to compile even with the #549 fix, gives the error e\Amazon\Lumberyard\1.28.0.0\dev\Code\Framework\AzFramework\AzFramework\IO\LocalFileIO.cpp(502): error C2440: '<function-style-cast>': cannot convert from 'initializer list' to 'AZStd::pair<const char *,const char *>'

e:\Amazon\Lumberyard\1.28.0.0\dev\Code\Framework\AzFramework\AzFramework\IO\LocalFileIO.cpp(502): note: No constructor could take the source type, or constructor overload resolution was ambiguous using Visual Studio 2019 16.10.0

Steps to reproduce Modify the Qt files using #549 fix and then build using the Project Configurator and Visual Studio 2019 16.10.0

Expected behavior Project builds successfully

Screenshots/Logs https://pastebin.com/xfp6N1Aq

Lumberyard version 1.28.0.0

ghost commented 3 years ago

Same problem here

AMZN-Gene commented 3 years ago

Thanks for reporting! We'll be looking into this critical issue.

If you need to work around the issue for now the recommended Microsoft Visual Studio 2019 version is 16.2.4 thru version 16.9.x. https://docs.aws.amazon.com/lumberyard/latest/userguide/setting-up-system-requirements.html

ratchet3789 commented 3 years ago

Awesome thank you. Given we're on Community Microsoft have made it a bit difficult. For anyone else having this issue, its down to a VS Version issue

To fix the error Uninstall your VS 2019 + VS Installer Download either of the pro versions of 16.9 from https://stackoverflow.com/questions/63304331/how-do-i-install-a-previous-version-of-visual-studio-2019-community Install Community 16.9 from here Generate your project in LY It should work!

hendradarwin commented 3 years ago

I also face same issue. I'm using VS 2019 version 16.10.3, and I found the workaround.

on the file \dev\Code\Framework\AzFramework\AzFramework\IO\LocalFileIO.cpp line 502 change from

m_aliases.push_back(AZStd::pair<const char*, const char*>(key, fullPath));

into

m_aliases.push_back(AZStd::pair<OSString, OSString>(key, fullPath));

The error will be gone and you should be able to compile AzFramework project.

AvailableJosh commented 2 years ago

I also face same issue. I'm using VS 2019 version 16.10.3, and I found the workaround.

on the file \dev\Code\Framework\AzFramework\AzFramework\IO\LocalFileIO.cpp line 502 change from

m_aliases.push_back(AZStd::pair<const char*, const char*>(key, fullPath));

into

m_aliases.push_back(AZStd::pair<OSString, OSString>(key, fullPath));

The error will be gone and you should be able to compile AzFramework project.

I can confirm this workaround works, it worked for me! I spent countless hours trying to figure out the legitimate cause for this error, thank you so much!