Migrating to UE5 => errors in msvc\filesystem

Hello,

I’m trying to compile my 4.27 project to UE5 and i get a ton of errors on msvc’s filesystem.
A few example:

2>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\INCLUDE\filesystem(893): error C4003: not enough arguments for function-like macro invocation 'concat'
2>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\INCLUDE\filesystem(893): error C4227: anachronism used: qualifiers on reference are ignored
2>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\INCLUDE\filesystem(893): error C2988: unrecognizable template declaration/definition
2>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\INCLUDE\filesystem(893): error C2143: syntax error: missing ';' before '&'
2>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\INCLUDE\filesystem(893): error C2365: '_Src': redefinition; previous definition was 'template parameter'
2>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\INCLUDE\filesystem(892): note: see declaration of '_Src'
2>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\INCLUDE\filesystem(893): error C2238: unexpected token(s) preceding ';'
2>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\INCLUDE\filesystem(893): error C2059: syntax error: '&'
2>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\INCLUDE\filesystem(893): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
2>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\INCLUDE\filesystem(898): error C2365: '_InIt': redefinition; previous definition was 'template parameter'

I tried various versions of MSVC, i even upgraded from VS2019 to VS2022 to be sure to get the latest everything, but i still get the same list of errors.

I guess my project configuration must be wrong somewhere but i couldn’t find anything related to this on google.

Any idea ?

Thanks
Cedric

Did you try a rebuild instead of just build?

I did, cleaning, deleting the projects folders (binaries, intermediate, etc), rebuilding, many times, with no visible effect.

When looking at this page:

It seems that C4003 is supposed to be a warning but i get an error instead.

So i guess that somewhere in my configuration is something that tells VS to treat warnings as errors.

To be continued…

Is there any official windows 10 sdk version to use with UE5 ?
I have tried 18362, 19041 (default), and 20348 with no success.

I tried to force versions of C++ (/c++17, /c++20, and nothing to let VS use its default version), but no luck.

Ok, problem solved.
_HAS_CXX17 wasn’t defined in my project and because of that, some necessary inclusions in the filesystem file weren’t made, leading to all those errors.
So i just had to define it in my build.cs and it compiled fine.

PublicDefinitions.Add("_HAS_CXX17=0");

Cedric

1 Like