I am working with Modelica models in the Modelica Buildings Library that call an external DLL containing C code. When using a Visual Studio compiler in Dymola, the models compile and simulate successfully without errors. However, when I use a MinGW GCC compiler in Dymola, the models fail to compile and I get this error, where ffd_dll
is the entrance to the code contained in the external DLL.
32-bit and 64-bit versions of the DLL are located in modelica_path/Buildings/Resources/Library/win32
and modelica_path/Buildings/Resources/Library/win64
, respectively. This library directory, modelica_path/Buildings/Resources/Library
, is defined in the Modelica model as well. My operating system is Windows 10 and this problem occurs using both Dymola 2020 and Dymola 2021.
I have verified the MinGW compiler as shown here. This compiler also works fine when using Modelica models that do not call external DLLs.
I believe the issue is the DLLs cannot be located when using the MinGW compiler, so I am wondering if there is something more I need to do to set up the compiler to help it locate the DLL.
Also, there is a reason I am interested in using the MinGW compiler in Dymola when the Visual Studio compiler works perfectly well. I have compiled another DLL containing mixed C and Fortran code using MinGW GCC and GFortran, but have run into issues using this DLL when using a Visual Studio compiler in Dymola. I thought using a MinGW GCC compiler in Dymola would be more appropriate since the DLL was compiled with a MinGW GCC compiler.