How to suppress (hide) LNK4221,4006 warning in Visual Studio 2015?
D:\solutionFolder\projectFolder\OgreHlmsPbs_d.lib(OgreHlmsPbs_d.dll) 1 __NULL_IMPORT_DESCRIPTOR already defined in OgreOverlay_d.lib(OgreOverlay_d.dll); second definition ignored LNK4006
D:\solutionFolder\projectFolder\OgreHlmsPbs_d.lib(OgreHlmsPbs_d.dll) 1 This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library LNK4221
The program run fine.
I use librarian (same as a SO question : LNK4006, LNK4221 warnings when using static library that includes another static library).
I have tried :-
- Linker > all options > additional option =
/ignore:4221,4006
- Linker > Command Line > additional option =
/ignore:4221,4006
- Librarian > all options > additional option =
/ignore:4221,4006
- Librarian > Command Line > additional option =
/ignore:4221,4006
I have set it to both user-project and the static library.
I have also tried /ignore:4221
alone for the above 4 combination, it can't suppress LINK4221.
Capital /IGNORE:4221
doesn't work either.
All of the above don't solve. Are there any other combination?
I don't want to modify my code e.g.
__declspec( dllexport ) void getRidOfLNK4221(){}
I have read :-
- How to eliminate Warning LNK4221? and Visual C++: How to disable specific linker warnings? (provide some of the above non-working solutions)
- http://www.geoffchappell.com/studies/msvc/link/link/options/ignore.htm implies that both 4221 and 4006 can be disable.
I guess this version of Visual Studio (2015) may have different way to fix this issue.
Further investigation
After posting the question, I found :-
- https://msdn.microsoft.com/en-us/library/b7whw3f3.aspx : The error is about not found
.pdb
. - How to remove warning LNK4099: PDB 'lib.pdb' was not found
I started to think that using librarian is probably not a good idea in the first place.
However, even I don't set librarian, I still get this warning for my own empty MyClass.cpp
.
Therefore, this problem is probably not related to librarian.
D:\solutionFolder\projectFolder\MyClass.obj 1 This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library LNK4221