VS2019 linker fails to detect the object file of static library with CFG enabled
We have a static library xyz.lib. It has abc.obj in it.
These object files are built with CFG flag enabled.
But creation of DLL from this static library fails with lot unresolved symbols.
LINK /nologo /NODEFAULTLIB /OPT:NOREF /NXCOMPAT /DynamicBase /STACK:2097152 /def:"xyz.def" /out:xyz.dll pqr.obj /implib:"xyz.lib" /dll xyz.lib
The same works fine. If I recreate/rearrange the xyz.lib with some dummy operations on static library(xyz.lib) as follows:
LIB xyz.lib /EXTRACT:abc.obj /OUT:abc.obj
LIB /out:xyz.lib xyz.lib abc.obj
Any specific reason for this behavior? Any workaround to resolve this problem?
NOTE: This behavior is not seen with Visual Studio 2015