# How to enable treat warnings as errors in Unreal Engine 4.24?

I've had little luck googling and it takes about an hour to build the engine (which I have to do if I'm to test if it works), so guessing is a bit time consuming.

I've seen advice to add the '/WX' flag to *.target.cs, as well to one of the functions in VCToolChain.cs, but I wasn't able to make it work.

Has anyone here enabled this and knows how it works? I don't think it matters, but I've been using VS2017.

# Assumptions

• You're building the Unreal Engine from the github source.
• You're on Windows 10.
• Instructions from Visual Studio 2019 Community Edition are similar to those for VS2017.

# Solution

The advice you got regarding /WX option is correct, but I don't think the *.target.cs file was the proper place to put it. I see hints that there is a variable to append additional command-line options in that file, but nothing solid. Also, since there are multiple targets that you can build, I figured the following is the safest way to go.

## Steps

1. Open the solution, UE4.sln.
2. Right-click on the project UE4 > Properties.
3. Go to Configuration Properties > NMake > Additional Options.
4. Append /WX to the list of options already there.
5. Press Okay and rerun your build.