For the case if you have troubles with C++ compiler and tools installation and some bugs, the following workaround will help you.
1) Download and install Microsoft Visual studio, say 2015.
2) Browse to C:\Program Files\ANSYS Inc\v172\fluent\ntbin\win64 and backup udf.bat to udf.bat.ORIG
3) Place the following code to udf.bat
@echo off
rem ---
rem MS Visual C++
rem ---
set MSVC=
set MSVC_VERSION=0
set MSVC_VERSION=172
call "c:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
echo Detected MSVC%MSVC_VERSION% under ""
echo path=%path%
echo include=%include%
echo lib=%lib%
4) Make sue that in Fluent launcher on the Environment Tab the the Set up Compilation Environment for UDF checkbox is picked up.
Enjoy...
Also useful information can be found here - COMPILING AND LOADING USER DEFINED FUNCTIONS USING FLUENT 14.5 OR 15.0