LINK : fatal error C1007: unrecognized flag '-Zc:nrvo' in 'p2'

P M Sherwood 6 Reputation points
2022-12-15T20:37:24.523+00:00

My project is native C++. Visual Studio Community 2019, 16.11.20 on 64-bit Windows 10.

I can build the debug version with no error, but when I build the release version, I get

LINK : fatal error C1007: unrecognized flag '-Zc:nrvo' in 'p2'

There is no flag containing 'nrvo' anywhere in either the C++ or linker command line. It seems this option has to do with automatic elision.

This error did not occur with previous builds, which I believe used VS 16.9. I am not sure of this.

How can I get rid of this error? I don't care which options are in effect for elision, but I do need to be able to produce an executable.

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,549 questions
{count} votes