question

cedric-7585 avatar image
0 Votes"
cedric-7585 asked cedric-7585 answered

Compiling errors in MSVC\14.32.31326\INCLUDE\filesystem

Hello,

My project is a very old Unreal Engine project, that has seen many versions of VS and UE.
I'm currently trying to migrate it to UE5 and i get a bunch of errors on a MSVC file:

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'
[...]

There are hundreds of those errors.
Moreover, some of those references are supposed to be warning (ex: C4003 and C4227) but are here treated as errors.

After a few hours of research/posting on the Unreal Forum and googling, i still have no clue of what the problem could be, or if there is some option in the project configuration telling the compiler to treat warnings as errors.

The configuration type of the project is Makfile, and i didn't specify any extra option regarding the warning level:

205350-ue5projectoptions.png

Any ideas where those strange errors could come from ?

Thanks
Cedric


c++vs-general
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @cedric-7585,

Thanks for taking time to report this problem with us. Since your question is more related to UE, you could go to UE Forum for support.

Regarding warnings turning into errors, you should check if the Project Properties->Configuration Properties->C/C++->General->Treat Warnings As Errors is set to Yes, change to NO to make the errors turn back to warnings.

205684-error.png

For other warnings like C4003, you could research the document in MSDN to read the cause and solution of the warning.

Best regards,

Elya


0 Votes 0 ·
error.png (60.2 KiB)

Hello Elya,

Thanks for your answer.
I think the question relates to both products.
On one hand the problem came when migrating from UE4 to UE5 with no change in my code, so yes, definitely UE5 related.
On the other, everything still sits on top of VS shoulders and the error displayed concerns an MSVC file, so also VS related.

Anyway, my first impulse was to turn to the Unreal forum as you suggested, and i actually did that 11 days ago:
https://forums.unrealengine.com/t/migrating-to-ue5-errors-in-msvc-filesystem/557592

but to this day, still no answer so i'm trying my luck here :-)

My project is a Makefile project, so i don't have the c/c++ options, but i added the /WX- on the NMake options:

205650-vs2022wx.png

but no success so far.

I have found on the net that there was some problems with this filesystem file, and that in some case, with c++17 it had to be replaced by "experimental/filesystem".
I can't change the code including this file, so i tried to force versions of c++ (c++17, c++20) and i also removed the option to let VS work with its default version.
Still no success.

Any idea from the VS point of view of what could cause this file to generate those errors ?
Do you think they are real errors or more a configuration problem hidden somewhere in the project ?

I'll take any suggestion since i've been banging my head against the wall with this problem for 2 weeks and i still have no clue what the cause could be^^

Thanks and regards
Cedric


0 Votes 0 ·
vs2022wx.png (16.8 KiB)

Hi @cedric-7585,

Since I am not an expert in VS, I contacted my colleague in the VS team to help you solve this problem.

0 Votes 0 ·

1 Answer

cedric-7585 avatar image
0 Votes"
cedric-7585 answered

Ok, problem solved.

The _HAS_CXX17 wasn't defined in my project, leading to the non inclusion of many headers, leading to all those errors.

205817-cxx2017include.png

Strangely enough, i couldn't find the pragma message in my logs, too bad, would have saved a lot of time^^

Anyway, after adding the required definition, it compiled fine.

Cheers
Cedric


cxx2017include.png (12.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.