Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Compile Error - LocalFileIO #553

Open
ratchet3789 opened this issue Jun 8, 2021 · 5 comments
Open

Compile Error - LocalFileIO #553

ratchet3789 opened this issue Jun 8, 2021 · 5 comments

Comments

@ratchet3789
Copy link

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
Copy link

ghost commented Jun 9, 2021

Same problem here

@AMZN-Gene
Copy link

AMZN-Gene commented Jun 9, 2021

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
Copy link
Author

ratchet3789 commented Jun 9, 2021

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
Copy link

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
Copy link

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!

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

No branches or pull requests

4 participants