LINK : fatal error LNK1104: cannot open file 'mfc140.lib'

Document ID : KB000045801
Last Modified Date : 14/02/2018
Show Technical Document Details

Problem:

 

I’m trying to generate and build W900 from the Sample Model and get a link error. According to the Release Notes, I can use any compiler starting with VS2010 or above. 

 

...Linking Load Module stub W900 

link /NOLOGO /SUBSYSTEM:WINDOWS -entry:WinMainCRTStartup -out:"C:\Gen\model86\sGUImsi.ief\c\W900.EXE" /DELAYLOAD:WRGN.DLL "C:\Gen\model86\sGUImsi.ief\c\OBJC\STUB.OBJ" "C:\Gen\model86\sGUImsi.ief\c\OBJC\STUBMAIN.OBJ" "C:\Gen\model86\sGUImsi.ief\c\STUB.RES" @"C:\Gen\model86\sGUImsi.ief\c\STUB.LNK" 

LINK : fatal error LNK1104: cannot open file 'mfc140.lib' 

NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\link.EXE"' : return code '0x450' 

Stop. 

 

I’m using VS2012 (OPT.VSVERSION = VS110). I tried with OPT.BUILD_SRC set to Yes and No and neither work. I do not have VS2015 installed which is think is the default compiler option in the Technical Requirements.

 

Workaround:

 

A generate and install was done when OPT.BUILD_SRC was set to NO. Next, A generate and install was done when OPT.BUILD_SRC was set to YES. 

The problem is that the second generate and install was using residual files from the first generate and install. Doing a Build Tool Clean (or deleting the ...\model.ief\c directory), setting OPT.BUILD_SRC to YES, generating and installing fixed the problem.