MinGW / GCC Delay loading DLL equivalent?

I am trying to port some old MSVC C ++ code to MinGW / GCC.

One of the problems is that the project is heavily dependent on the / DELAYLOAD option for functions that are not always used, and where the corresponding dll is at runtime.

Is there such a similar option for MinGW / GCC?

This code is for the Windows platform.

+4
source share
2 answers

For elf purposes (for Unix-like systems), you can specify the -z lazy option (which is the default by default) with ld (a linker that also uses MinGW).

As far as I know, the target i386 PE (for Windows) does not have , has an explicit version of the lazy link. I can not find documentation about its availability.

+6
source

And I would add that although load-delayed DLLs are part of Windows, they are actually implemented in terms of the small stubs generated by the linker. At least that was the case. Thus, at the Windows OS level, the formal concept of โ€œdelay loadingโ€ does not exist. There is a convention based on the binary code emitted by the linker.

+3
source

All Articles