-- VC++

About warning:LNK4089

어린왕자악꿍 2008. 4. 11. 09:24

[Q]

Hi, everyone

In release build, I get warning LNK4089, but it didn't occcure in debug mode. The project is MFC, I use it just becasue I want to use Cstring class. My questions are,

1. It this link warning important ? From MSDN help, it doesn't matter much, I think

2.I can get rid of this warning by using option [/IGNORE:4089]. Is this the best method.

3.What's the difference between release/debug mode when this warning happens?

Thank you

[A]
 

This warning simply means that you are linking against a library and the linker has detected that you are not really using any functions from it. The detecting is happened in linking time when you set /OPT:REF switch on.

In release build, I get warning LNK4089, but it didn't occcure in debug mode.

LNK4089 didn't occure in debug mode because /OPT:DEF switch of the linker is not set by default.

1. It this link warning important ? From MSDN help, it doesn't matter much, I think

I agree, if this optimization does not generate any runtime error, its not important.

2.I can get rid of this warning by using option [/IGNORE:4089]. Is this the best method.

It depneds on the result of optimization, if it is good, use /IGNORE:4089 is the best way, otherwise, switch of /OPT:REF to get rid of this warning. 

3.What's the difference between release/debug mode when this warning happens?

The difference is if the /OPT:REF is switched on or not.

 

thanks

bite


출처 : http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1170586&SiteID=1