The following errors are received when building Gen 8.6 COM Proxy with OPT.BITS set to 32 and 64 using Microsoft Visual Studio 2017:
Server1.out when OPT.BITS=32
=========================
---Compiles for Server1CM.DLL Dependencies done
...Linking Server1CM.DLL
link /NOLOGO /DLL /SUBSYSTEM:WINDOWS /MACHINE:X86 /NODEFAULTLIB:LIBCMT.LIB /def:"D:\CA Gen 8.6 Models\model1.ief\proxy\com\src\Server1\Server1CM.DEF" /out:"D:\CA Gen 8.6 Models\model1.ief\proxy\com\deploy\Server1\Server1CM.DLL" @"D:\CA Gen 8.6 Models\model1.ief\proxy\com\src\Server1\Server1CM.lnk"
D:\CA Gen 8.6 Models\model1.ief\proxy\com\src\Server1\Server1ECM.OBJ : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\link.EXE"' : return code '0x458'
Stop.
****************************
Link step for Server1CM.DLL failed with errors.
****************************
IEFSIGNAL:FAIL
*** Build for Load Module Server1 Failed. ***
=============================
Server1.out when OPT.BITS=64
=========================
---Compiles for Server1CM.DLL Dependencies done
...Linking Server1CM.DLL
link /NOLOGO /DLL /SUBSYSTEM:WINDOWS /MACHINE:X64 /NODEFAULTLIB:LIBCMT.LIB /def:"D:\CA Gen 8.6 Models\model1.ief\proxy\com\src\Server1\Server1CM.DEF" /out:"D:\CA Gen 8.6 Models\model1.ief\proxy\com\deploy\Server1\Server1CM.DLL" @"D:\CA Gen 8.6 Models\model1.ief\proxy\com\src\Server1\Server1CM.lnk"
LINK : fatal error LNK1181: cannot open input file 'USER32.LIB'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\link.EXE"' : return code '0x49d'
Stop.
****************************
Link step for Server1CM.DLL failed with errors.
****************************
IEFSIGNAL:FAIL
*** Build for Load Module Server1 Failed. ***
==============================
Release : 8.6
Component : Gen Build Tool
Gen 8.0 and Visual Studio 2010 are also installed on same machine.
Both 32 & 64 bit out files have errors referencing the Visual Studio 2010 64-bit link.exe program "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\link.EXE"'.
The VS 2010 directory had been added to the System PATH environment variable. For Gen 8.6 (or 8.0) to work correctly with the selected version of Visual Studio nothing needs to be manually added to environment variables. The Build Tool (BT) profile token values for OPT.BITS and OPT.VSVERSION are used by the BT scripts (genbits.scr, genbits_check.scr, callvsvars.scr) to setup all required environment variables to access the corresponding Visual Studio files for 32-bit or 64-bit compile and link steps.
After removing the VS 2010 directory from the PATH the 32-bit build still failed with:
===
*** Error: NMAKE.EXE not found in the PATH. ***
*** Error: CL.EXE not found in the PATH. ***
*** Error: LINK.EXE not found in the PATH. ***
===
For 32-bit builds those 3 missing Visual Studio executables nmake.exe, cl.exe, link.exe are located in this VS 2017 directory:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x86
The problem was resolved by having the correct VS 2017 options installed and "Desktop development with C++" appears to have been the crucial one
For further details see KB article: Gen 8.6 required MS Visual Studio 2017 or 2019 options