I am trying to launch an executable which I compiled using Fortran and Visual Studio 2019 from a Python script. Upon launch, the following error is generated:
"The procedure entry point for_stop_core_quiet could not be located in the dynamic link library..."
I have installed the Fortran runtime library, and I can launch the exe from command prompt without any issues. It's only when I try to launch from Python when the error is generated.
I have tried various approaches in python, using subprocess.run, subrocess.Popen, sys-related commands, but none of them works.
Is there something else related to the Fortran runtime library which I may be missing?
Any insight would be much appreciated.
Check that the value of the PATH environment variable, within the python script at the time that it attempts to load your executable, includes the directory with the intended/installed runtime library DLLs (C:\Program Files (x86)\Common Files\Intel\Shared Libraries\intel64 or similar) ahead of any other directory on PATH that might contain an older version of the runtime DLLs.
(A relatively simple way of doing this is to substitute a program that just prints the value of PATH for your program.)
Thank you both for the reply. Both approaches worked, with the /libs:static option being the simpler solution in this case. I plan to give the compiled Fortran executable together with the Python wrapper to my undergrad students for use in their aerodynamics/aircraft design courses, so the least amount of setting up/modifications they have to do, the better.