7.1: How to specify delayload in cpp file?

  • Thread starter Thread starter Stefan Slapeta
  • Start date Start date
S

Stefan Slapeta

Hi all,

I wonder how to specify the delayload option for the linker in a cpp file.
In VC 6 this was possible by writing

#pragma comment (linker, "/delayload:some_lib.dll")


When I do the same in 7.1, I get the message

abc.lib(xy.obj) : warning LNK4229: invalid directive
'/DELAYLOAD:some_lib.dll' encountered; ignored

although the syntax of the option is correct IMO.


Any solutions?

Thanks,

Stefan
 
I wonder how to specify the delayload option for the linker in a cpp file.
In VC 6 this was possible by writing

#pragma comment (linker, "/delayload:some_lib.dll")


When I do the same in 7.1, I get the message

Stefan,

I can only assume that's been dropped from the compiler. In VS you can
specify the delay load DLLs in the IDE's linker project settings.

Dave
 
Hi David,

the message

abc.lib(xy.obj) : warning LNK4229: invalid directive
'/DELAYLOAD:some_lib.dll' encountered; ignored

tells me, that is has not been dropped but that the linker obviously has a
problem with interpreting it correctly. The project option doesn't help in
some cases where you automatically want to import a library based on using a
particular cpp file. (You also speficy #pragma comment (lib, "....") then!)

Stefan
 
the message
abc.lib(xy.obj) : warning LNK4229: invalid directive
'/DELAYLOAD:some_lib.dll' encountered; ignored

tells me, that is has not been dropped but that the linker obviously has a
problem with interpreting it correctly.

Yeah, but maybe that amounts to the same thing :)

If someone from MS doesn't comment on this thread soon I'll try to
report it to them.

Dave
 
Stefan,

The comment from MS is that the new behaviour is expected. The
previous behaviour with VC6 was not intentional and could lead to
problems (I don't know what they may be though).

Dave
 
Back
Top