How to deal with 3rd party c++ libraries LNK4099 Warning in VisualStudio

后端 未结 1 1053
死守一世寂寞
死守一世寂寞 2021-02-10 03:02

I have a Visual Studio c++ project where I use the linker Settings

/WX (TreatWarningsAsLinkerErrors=true)

In Debug, I compile with /Zi (Debug D

1条回答
  •  长情又很酷
    2021-02-10 03:08

    Easiest way if you use a VS post 2010 (so 2012/2013/2015) is to add the /ignore:4099 option to the linker. Should ignore this specific warning. Sure that before 2012 this warning was specifically ignored... It existed but was a kind of "yeah but we do not care" warning.

    More complex way... If you have the "energy/motivation/advanced user courage/Visual studio 2010 or before [2008/VC6/...]" You can actually extract the symbols used during linking using the lib command lib /list obj.lib. You will obtain a lit of the obj included in the lib, that you can extract with the lib /extact ../path/to/my/obj command. THEN you have to extract the debug section using the dumpbin /section:.debug$ And there you will find the pdb problem... using /fd command you can relink correctly the pdb. It is somehow a lot of work. This is the short summary of what you can find here : https://cldoten.wordpress.com/2009/07/01/vs2008-fixing-the-warning-pdb-vc90-pdb-not-found/ Follow the link I gave carefully.

    Obviously the ignore method is probably the easiest and less problematic, especially if you use a lot of third-party libraries.

    0 讨论(0)
提交回复
热议问题