Technical Solutions

A Quick Technical Solution Guide

  • Categories

  • Archives

error LNK2005: “char const * const g_pszKernelObjFmt” (?g_pszKernelObjFmt@@3PBDB) already defined in atls.lib(Externs.obj)

Posted by ravidhole on May 16, 2008


Causes
Version 5.0.1, 2, 3 of the SDK requires ATL support (atls.lib). Since MFC also requires ATL and is the example is built in the debug configuration, the linker adds atlsd.lib. The symbols between the release and the debug library are the same, hence the LNK2005 “already defined” error. The library also defines symbol which is defined in the ATL library (ATL::AtlWinModuleInit), whence the LNK2005 error for this symbol. Only the Release configuration is shipped. For this reason, LIBCMT is also being requested as a default library, whence the LNK4098 error for this symbol.

Workaround
Ignore the following default libraries: libcmt;atls and add the /FORCE:MULTIPLE switch.

Status
This is a known issue with the SDK and/or SDK examples and is scheduled to be fixed in a future release.

For more details http://www.lizardtech.com/support/kb/viewtopic.php?t=78&

Leave a comment