388,684 Members | 6,647 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 388,684 IT Pros & Developers. It's quick & easy.

7.1: How to specify delayload in cpp file?

Stefan Slapeta
P: n/a
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
Nov 16 '05 #1
Share this Question
Share on Google+
4 Replies


David Lowndes
P: n/a
>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
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 16 '05 #2

Stefan Slapeta
P: n/a
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

"David Lowndes" <davidl@mvps.org> schrieb im Newsbeitrag
news:n17jnvs5sg6i3euieplfrbmii489uhqq04@4ax.com...
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
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Nov 16 '05 #3

David Lowndes
P: n/a
>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
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 16 '05 #4

David Lowndes
P: n/a
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
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.