vinayBLR080
vinayBLR080

Reputation: 1

Static libraries(.lib) built with VS2010 fails to link to an application which is being built with VS2015 in DEBUG mode

I am facing the following issue as follows: Background: I have built a static library(libXYZload.lib) using VS2010. The same library(libXYZload.lib) is being used while building(linking) the test application(testapp.exe) with VS2015 in DEBUG mode.

Problem Description: I am able to build my application 'testapp.exe' using VS2010 and VS2012 by linking the static library(libXYZload.lib) built with VS2010. But with VS2015, I get the following error:

LINK /nologo /NODEFAULTLIB /OPT:NOREF /NXCOMPAT /DynamicBase  /SAFESEH /out:testapp.exe testapp.obj ml_new.obj ml_trl.lib libsb.lib libcrvs.lib libcat.lib libXYZload.lib libXYZload.lib libredir_std.lib libredir_std.lib legacy_stdio_wide_specifiers.lib legacy_stdio_definitions.lib libvcruntime.lib libucrt.lib oldnames.lib kernel32.lib user32.lib netapi32.lib  gdi32.lib comdlg32.lib  comctl32.lib wsock32.lib shell32.lib  Rpcrt4.lib oleaut32.lib Ole32.lib Wbemuuid.lib wintrust.lib crypt32.lib Ws2_32.lib iphlpapi.lib Psapi.lib advapi32.lib Shlwapi.lib dhcpcsvc.lib userenv.lib tbs.lib libcmt.lib test_dongle_stub.lib

test_dongle_stub.lib(m_xyzstub.obj) : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:LBR' specification

libXYZload.lib(TestlmCICO.obj) : error LNK2019: unresolved external symbol "public: char const * __thiscall type_info::name(struct __type_info_node *)const " (?name@type_info@@QBEPBDPAU__type_info_node@@@Z) referenced in function _Security_Testing libXYZload.lib(TestPublicInterface.obj) :

error LNK2001: unresolved external symbol "public: char const * __thiscall type_info::name(struct __type_info_node *)const " (?name@type_info@@QBEPBDPAU__type_info_node@@@Z) testapp.exe : fatal

error LNK1120: 1 unresolved externals NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\LINK.EXE"' : return code '0x460' Stop.

I am not able to identify which symbol is missing from the library as it builds successfully on VS2010 and VS2012 Can someone please explain the reason for getting the above error? and how to resolve it?

NOTE:This issue happens only in DEBUG mode and works fine in release mode.

Upvotes: 0

Views: 730

Answers (1)

MSalters
MSalters

Reputation: 179859

The problem is in the type_info class, which is part of the implementation. This class is not the same in VS2010 and VS2015.

You solve it by building all components with the same compiler.

Upvotes: 1

Related Questions