Fluids

Fluids

LINK : fatal error LNK1104: cannot open file ‘kernel32.lib’

    • zwhite
      Subscriber

      I am using Ansys Fluent 2021 R2 and VS 2022 Community. I get the errror:

      "

      LINK : fatal error LNK1104: cannot open file 'kernel32.lib'

      NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\link.EXE"' : return code '0x450'

      "

      when trying to compile my UDF c code. I modified my udf.bat file to include the newer version of VS2022 to select it for its compiler. I moved all of the header files to the 'main' folder in my version of fluent as well as all the libraries it is referencing including kernel32.Lib. I am not sure why I am still getting this error. Within VS2022 I started a new project that contains my c files and included all the directories needed to build the file and I do get a few errors regarding syntax and undefined  CX_DLL_PTF_void from the header files that ansys fluent provides. I changed the Windows SDK Version to 10.0.22621.0 (the lastest Windows 11 SDK version since I have windows 11 on my desktop) and added my windows enviroment path "C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\arm64, C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\lib\onecore\x86, C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\um\x64,C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\HostX86\x64\,C:\Program Files\ANSYS Inc\v212\fluent\ntbin\clang\10\Include\10.0.18362.0\ucrt, and C:\Program Files\ANSYS Inc\v212\fluent\ntbin\clang\lib " that should contain all the libraries and header files. 

    • Swathi V. V.
      Ansys Employee

      Hi zwhite,

      I guess your VS installation is not done correctly.

      For the Ansys version you are using, fluent has a built-in-compiler which can be used instead of VS. To activate it, click the Use Built-in-compiler in the UDF compiler panel.

       

       

      • zwhite
        Subscriber

         

        I am not sure if this matters either but I am accessing Fluent through Workbench and I am accessing workbench through my desktop start page. Do I need to open workbench or fluent through visual studio in order for it to recognize the enviroment? (I also made comments underneath not knowing if you revieve notification or replies in the thread)

         

    • zwhite
      Subscriber

      I have already tried repairing (and uninstalling and reinstalling) VS2022 and have downloaded many of the packages available to fluent with the exception of spectre since some post say there may be some errors involved. Is there a place for me to know what packages I will need for to compile the UDFs? If you like I can post all the packages on Visual Studio I have and perhaps tell me if I am missing a package.

    • zwhite
      Subscriber

      I tried using the built in compiler too but it gives me errors that I know I didn't have before with previous versions of fluent (2019) and Visual Studio (2013). I was able to compile the same code I am using now so I wouldn't expect different errors to populate. Do I need to do anything special or have certain directories or enviroment paths for the built-in compiler?

    • Rob
      Ansys Employee

      What errors are you seeing with the built in compiler?

      • zwhite
        Subscriber

         

        ”C:\PROGRA~1\ANSYSI~1\v212\fluent/../commonfiles/CPython/3_7/winx64/Release/python/scons”

        scons: Reading SConscript files …

        Compiler used is “C:\PROGRA~1\ANSYSI~1\v212\fluent”\ntbin\clang\bin\clang-cl

        Linker used is “C:\PROGRA~1\ANSYSI~1\v212\fluent”\ntbin\clang\bin\lld-link

         

        ~Other copying information~

         

        lld-link: error: could not open ‘LIBCMT.lib’: no such file or directory

        scons: *** [libudf.dll] Error 1

        scons: building terminated because of errors.

         

        That file is located here: C:\Program Files\ANSYS Inc\v212\fluent\ntbin\clang\lib

Viewing 4 reply threads
  • You must be logged in to reply to this topic.