Windows build script gives error unresolved external symbol

Problem using a Visual Studio command prompt to compile the ECI and ESI V2 samples with the .cmd build script.

Symptom

The link command fails with the following messages:

> link /LIBPATH:"C:\Program Files (x86)\IBM\CICS Transaction Gateway\lib64" 
/DEBUG "C:\ProgramData\IBM\CICS Transaction Gateway\samples\c\esi_v2\ctgesib1.obj" 
ctgclient.lib /OUT:"C:\ProgramData\IBM\CICS Transaction Gateway\samples\c\esi_v2\ctgesib1.exe"
Microsoft (R) Incremental Linker Version 12.00.30501.0
Copyright (C) Microsoft Corporation. All rights reserved.

ctgesib1.obj : error LNK2019: unresolved external symbol _CTG_openRemoteGatewayConnection referenced in function _openGatewayConnection
ctgesib1.obj : error LNK2019: unresolved external symbol _CTG_closeGatewayConnection referenced in function _closeGatewayConnection
ctgesib1.obj : error LNK2019: unresolved external symbol _CTG_getRcString referenced in function _displayRc
ctgesib1.obj : error LNK2019: unresolved external symbol _CTG_listSystems referenced in function _selectServer
ctgesib1.obj : error LNK2019: unresolved external symbol _CTG_ESI_verifyPassword referenced in function _verifyUser
ctgesib1.obj : error LNK2019: unresolved external symbol _CTG_ESI_convertTime referenced in function _verifyUser

C:\ProgramData\IBM\CICS Transaction Gateway\samples\c\esi_v2\ctgesib1.exe : fatal error LNK1120: 6 unresolved externals

Probable cause

The wrong Visual Studio environment is being used. This can happen when the build script requests a 64-bit compilation but was run from a 32-bit Visual Studio command prompt or a 32-bit compilation was requested from a 64-bit Visual Studio command prompt.

Action

Open a new Visual Studio command prompt with the correct build environment and run the build script.