Compile Error - LocalFileIO

5
open
ratchet3789
ratchet3789
Posted 5 months ago

Compile Error - LocalFileIO #553

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

WhyAreLess
WhyAreLess
Created 5 months ago

Same problem here

AMZN-Gene
AMZN-Gene
Created 5 months 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
ratchet3789
Created 5 months 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
hendradarwin
Created 4 months 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
AvailableJosh
Created 1 week 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!