Reputation: 867
Attempting to link an app gives large number of errors such as
1>LINK : warning LNK4098: defaultlib 'mfc140d.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'mfcs140d.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'msvcrtd.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Move.obj : warning LNK4217: locally defined symbol islower imported in function "struct Token __cdecl NextToken(char * const,int &)" (?NextToken@@YA?AUToken@@QEADAEAH@Z)
1>Move.obj : warning LNK4217: locally defined symbol isdigit imported in function "struct Token __cdecl NextToken(char * const,int &)" (?NextToken@@YA?AUToken@@QEADAEAH@Z)
1>Position.obj : warning LNK4049: locally defined symbol isdigit imported
Position.cpp and Move.cpp are my code. What is the meaning of these errors, and how can I correct them?
This is Visual Studio 2015, and the project was imported from Visual Studio 2010. Windows 7 Pro 64.
Upvotes: 1
Views: 3116
Reputation: 867
Turns out that I had included linker input from libraries nafxcwd.lib and libcmtd.lib, from some prior version of VS. VS2015 has added warnings when the libraries conflict. Removing both nafxcwd.lib and libcmtd.lib from the list of linker inputs fixed the problem, and the project now links with no errors.
Upvotes: 0
Reputation: 41
Use the /VERBOSE:LIB switch in the linker as instructed at this msdn page in order to try to understand what is going on.
I had the same kind of complains with the mfc140d.lib and the mfcs140d.lib and the issue was that in my project I had a mix of libraries complied in UniCode and MCBS. Essentially /VERBOSE:LIB was also listing the ones complied with for unicode named mfc140ud.lib and the mfcs140ud.lib I switched to MCBS character set only and the problem disappeared.
Upvotes: 2