views:

308

answers:

2

Hello, I'm trying to port some old MSVC C++ code to MinGW/GCC.

One problem is that the project relies heavily on the /DELAYLOAD option for functions that aren't always used, and where the proper dll is located at runtime.

Is there such a similar option on MinGW/GCC?

This code is targeting the windows platform.

+3  A: 

On elf targets (for Unix-like systems), you can specify the -z lazy option (which is the default anyway) with ld (the linker that MinGW also uses).

As far as I know, the i386 PE target (for Windows) does not have an explicit lazy linking option. I can find no documentation of it being available.

greyfade
That's most unfortunate. I'll have to come up with some sort of workaround. Thank you for the help!
VoiDeD
A: 

And I would add that, although delay-load DLLs appear to be a part of the Windows OS, they're actually implemented in terms of small stubs generated by the linker. At least, this used to be the case. So there is no formal notion of "delay loading" at the Windows OS level. There's a convention, based on binary code emitted by the linker.

James D