7.1: How to specify delayload in cpp file?

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
 
D

David Lowndes

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
 
S

Stefan Slapeta

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
 
D

David Lowndes

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
 
D

David Lowndes

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top