Some updates from me.

1, I think it may be because of ansy fluent does not fully support cpp language. As far as I know all the example udfs in fluent are based on c language.

2, If ansys could tell us how to properly setup visual studio to make it fully support fluent udf that would be great. Could you provide any guidance on this? I think there is little information we can find in ansys help document or google for this.

3, A possible solution from me: fully rewritten the cpp code to remove all the data types and functions that need call cpp header files, for example, iostream, string, vector, memory. I have fully rewritten my cpp code to replace all these functions by c-based code and keep the cpp based classes. The udf is running OK. Although this can resolve the issue, it is not the perfect way to do.