Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

UDF Compilation error cannot open include file ‘stdio.h’

    • ag1991
      Subscriber

      Hello, I am using ANSYS 2019 R1 on Windows 10 with Microsoft Visual Studio 2017 installed. Whenever I'm attempting to compile a udf file and clic 'build' I get the following messages on the TUI:


      Copied D:Users...dp0FFFFluent/D:Users...dp0FFFFluent1dof_rotation.c to libudfsrc


      udf_names.c and user_nt.udf files in 2ddp_host are upto date.


      (system "copy "C:PROGRA~1ANSYSI~1v193fluent"fluent19.3.0srcudfmakefile_nt.udf "libudfwin642ddp_hostmakefile" ")


      1 copied archive(s).


      (chdir "libudf")(chdir "win642ddp_host")# Generating ud_io1.h


      1dof_rotation.c


      C:PROGRA~1ANSYSI~1v193fluentfluent19.3.0srcmainglobal.h(9): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory


      udf_names.c and user_nt.udf files in 2ddp_node are upto date.


      (system "copy "C:PROGRA~1ANSYSI~1v193fluent"fluent19.3.0srcudfmakefile_nt.udf "libudfwin642ddp_nodemakefile" ")


      1 copied archive(s).


      (chdir "libudf")(chdir "win642ddp_node")# Generating ud_io1.h


      1dof_rotation.c


       


      C:PROGRA~1ANSYSI~1v193fluentfluent19.3.0srcmainglobal.h(9): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory


      As far as I am concerned, I overcame the typical 'nmake' problem but I'm stuck right here, I properly changed the values for the environment variables, it seems like it can't find this stdio header just because it doesn't exist (I have been searching it through all the installed archives from MVS2017). This makes me conclude on there might be some work load or optional component I must missed to install. What are exactly the required ones?


      Thank you in advance

      PS: I deleted in this message some part of the path due to confidencial reasons, nevertheless, I'd like to make it clear that there are no spaces between words in none of the archives appearing on the path.

    • Karthik Remella
      Administrator

      Hello,


      MS Visual Studio 2017 should work well for Fluent R193. I'm thinking the issue could have been because of the changes you've made to your environment variables. This should never have been done. Please reinstall your compiler, install the SDKs, and remove any custom variables you might have defined. Please let us know how things are behaving once you've done so.


      Thank you.


      Best Regards,


      Karthik

    • ag1991
      Subscriber

      Hello again, the problem was solved.


      The compiler and SDKs were OK, however, the problem came from the environment variables. The ones pre-defined neither weren't the right ones, so I tried to execute Fluent from the MS VS2017 command prompt, succeeding at building and loading the udf. Once there, I typed 'env' on the command prompt and got all of the environment variables.


      It appears there were some of them that weren't actually defined, so I had to creat them and then I became able to work with udf archives from ANSYS Fluent. I understand the proper installation of ANSYS should have defined them, but it didn't (there are some .exe called 'setenv' in order to do so).


      Thanks.

    • Karthik Remella
      Administrator

      Hello,


      Could you please mark the answer as 'Is Solution'? I'm sure this is something that might benefit others in the community.


      Thank you.


      Best Regards,
      Karthik

    • carmendecrescenzo90
      Subscriber

      Hello,


      I am working on  volume rate reaction UDF to add in Fluent. I am usnig Ansys 2019 R3 Academic and Visual Studio Community 2019. After building UDF the following error message appears:  "fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory".


      And after loading  the libudf the error is "Error: The UDF library you are trying to load is not compiled for 2d on the current platform (win64)"


      How can I solve these problems?


      Thank you in advance


      Best regards


       


      Carmen

    • Karthik Remella
      Administrator

      Hello,


       Please reinstall your compiler, install the SDKs, and remove any custom environment variables (if any) you might have defined.


      This message is indicating that you have not installed the compiler correctly. 


      Also, for better visibility, please create a separate post for each question. This will increase the visibility on your question.


      Thanks.


      Karthik

    • ag1991
      Subscriber

      Hi,


      try executing Fluent from the MS VS2019  command prompt and check if you succeed at building and loading the udf. Once there, type 'env' on the command prompt and you'll get all of the environment variables.


      Then, define all used env. vars. in their respective Windows menu.


      Hope it works.

    • Amoghavsomayaji
      Subscriber
      I am facing a problem similar to the above mentioned ones.I have noticed that stdio.h file and udf.bat files are missing.Please explain the solution step by step.I am very new to this software.
    • Rob
      Forum Moderator
      Try using the Built in Compiler in 2020R2. As an aside, if you're new to Fluent UDFs are probably not a good starting point. n
    • Amoghavsomayaji
      Subscriber
      Thanks a lot,Rob. Built in compiler in 2020R2 is a game changer.n
    • cfd_learner
      Subscriber
      Will you please explain the steps/environment variables you set?n
    • ag1991
      Subscriber

      Sure, Open Windows command prompt (type 'cmd' on a Windows OS in the 'Search' toolbar). Make sure you've got installed Microsoft Visual Studio 2019, any other versions can run well, but this one worked out fine for me

      Execute Fluent from that command shell

      Inside Fluent, build and load your UDF. If you are succesful, a libudf directory will be created on your workind directory

      Once more, back to the command shell. Type now 'env'. This will show you all of the environment variables defined when you executed Fluent from command shell.

      Copy all those environment variables and define them on your system, dully linking them to ANSYS

      It's been a long time since I did this, but I believe more or less these should be the steps.nGood luch.

Viewing 11 reply threads
  • The topic ‘UDF Compilation error cannot open include file ‘stdio.h’’ is closed to new replies.
[bingo_chatbox]