Questions about importing library file xxx.dll.a when generating dynamic library in window environment

In the window environment, when gcc generates the share dynamic dll library, it is always accompanied by the file xxx.dll.a. I searched and learned that this file is an import library, but I cannot find the function and usage of this file. Does anyone know the function? Boss?

This file is used when linking to the library. It contains information about symbols that the library exposes.
On Linux all the information needed is in the .so file, but Windows split it for some reason, so you need an import library (.dll.a, *.lib) for linking, but the actual code resides in *.dll. Only the *.dll is required when running the application.

Hello, when win is linked through cmake, there is no .dll.a import library. Will the link fail?

It doesn’t matter if you use CMake or something else - the linker uses the import library. So yes, either the .dll.a (in case of MinGW), or the .lib (MSVC, and probably clang) must exist. The linker does not care about the actual .dll.

OK, thanks.

There is explanatory information about the DLL search path and import library