-
-
August 24, 2022 at 5:59 pm
zwhite
SubscriberI 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.
-
August 25, 2022 at 4:12 am
Swathi V. V.
Ansys EmployeeHi 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.
-
August 25, 2022 at 5:44 am
zwhite
SubscriberI 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)
-
-
August 25, 2022 at 4:58 am
zwhite
SubscriberI 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.
-
August 25, 2022 at 5:01 am
zwhite
SubscriberI 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?
-
August 25, 2022 at 1:27 pm
Rob
Ansys EmployeeWhat errors are you seeing with the built in compiler?
-
August 25, 2022 at 1:35 pm
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
-
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- The solver failed with a non-zero exit code of : 2
- Difference between K-epsilon and K-omega Turbulence Model
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error in cfd post
-
2706
-
2146
-
1357
-
1148
-
462
© 2023 Copyright ANSYS, Inc. All rights reserved.