When you compile the UDF, do you see any errors? Are you able to use the UDF being added in the drop-down list in your velocity inlet boundary condition panel? Are you able to select it and hook it to the boundary condition?
There are UDF samples in the Fluent Customization Manual for velocity inlet boundary condition. You could try one of those to make sure UDF work on your system and that you have all the prerequisites installed for successfully compiling your UDF.