When linking with jpeg.lib, link time code generation must be turned on as jpeg.lib was generated with
/GL enabled (it’s a release build), which in turn disables incremental linking, which may increase linking time and likely cause a crash during the command line debug build using msbuild.
See the warnings below:
jpeg.lib(jdapimin.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance 1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification 1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
Both options are reflected to the corresponding settings now:
/LTCG and /INCREMENTAL:NO.
/NODEFAULTLIB:MSVCRT is used with the linker as the jpeg.lib and libpng15.lib were previously linked (by
/MD option) with the release version runtime (MSVCRT.LIB) whereas the project will be linked (by
/MDd option) with debug version runtime (MSVCRTD.LIB) in debug build. The option enforces to ignore MSVCRT.LIB and to use MSVCRTD.LIB only.
Referred to this forum.