Why does Ansys Fluent UDF compiler report a syntax error in udf_names.c?
udf_names.c is created during the compilation process automatically. There are several reasons why you might get compiler errors for that file, all of them mean that you violated basic UDF requirements.
A typical error in early stages of UDF development could be:
udf_names.c(7) : error C2059: syntax error : '}'
udf_names.c(8) : warning C4034: sizeof returns 0
If you look at the file that you can find in the udf library folder structure, you can see that there is an empty array defined which is not valid. For Windows, lines 6 and 7 might look like the following:
__declspec(dllexport) UDF_Data udf_data[] = {
};
This array should contain all the UDFs. Since it is empty, it means you forgot to create at least one DEFINE macro to your *.c or *.cpp source file. This can happen easily when starting the development, a more complex UDF with many smaller functions.
Always have at least one DEFINE macro in your code. Remember that you can access all functions defined with DEFINE macros also directly. So, a DEFINE_ON_DEMAND can be accessed like any void function.