Hi Gagan,
Don't know if relevant but I note your Windows Kits (SDK) version is
10.0.17763.0 compared to my
10.0.10240.0. Mine was installed by the VS 2015 install (version 14.00.24210.1 shows in my Programs and Features) Start VS and go to Help/About shows
===
Microsoft Visual Studio Professional 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework Version 4.8.03761
Installed Version: Professional
Visual Basic 2015 Microsoft Visual Basic 2015
Visual C# 2015 Microsoft Visual C# 2015
Visual C++ 2015 Microsoft Visual C++ 2015
Application Insights Tools for Visual Studio Package 7.0.20622.1Application Insights Tools for Visual Studio
ASP.NET and Web Tools 2015.1 (Beta8) 14.1.11107.0 ASP.NET and Web Tools 2015.1 (Beta8)
ASP.NET Web Frameworks and Tools 2012.2 4.1.41102.0 For additional information, visit
http://go.microsoft.com/fwlink/?LinkID=309563ASP.NET Web Frameworks and Tools 2013 5.2.40314.0 For additional information, visit
http://www.asp.net/Common Azure Tools 1.8 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
JavaScript Language Service 2.0 JavaScript Language Service
JavaScript Project System 2.0J avaScript Project System
Microsoft Azure Mobile Services Tools 1.4 Microsoft Azure Mobile Services Tools
NuGet Package Manager 3.4.4 NuGet Package Manager in Visual Studio. For more information about NuGet, visit
http://docs.nuget.org/.PreEmptive Analytics Visualizer 1.2 Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.
SQL Server Data Tools 14.0.60519.0 Microsoft SQL Server Data Tools
TypeScript 1.8.36.0 TypeScript tools for Visual Studio
===
You may also want to try the VERBOSE option for the STUBLINK to see if it sheds any more light compared to my equivalent output.
Regards,
Lynn
------------------------------
Lynn Williams
Senior Principal Support Engineer
Broadcom
Australia
------------------------------
Original Message:
Sent: 05-20-2020 02:24 AM
From: Gagan Kakkar
Subject: Gen 8.6 build failed
Hi Lynn,
Many thanks for all the information/suggestions.
I tried a few things including using double quotes round the full path to legacy_stdio_definitions.lib for LOC.EXTERNAL_LIB and running "%VS140COMNTOOLS%\vsvars32.bat" manually from a command prompt. This is what echo %LIB% shows.
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB;C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x86;C:\Program Files (x86)\Windows Kits\10\lib\10.0.17763.0\um\x86;C:\PROGRA~1\IBM\SQLLIB\LIB;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x86;
After then I ran GUIMENU.bat from the same command prompt. Still the same error message. :(
STUB.OBJ : error LNK2019: unresolved external symbol _sprintf referenced in function _C4ERRMSG
Looks like issue could be with my VS 2015 installation.
Thanks.
Gagan
------------------------------
IT Consultant - CA Gen
Infosys - AIB
Original Message:
Sent: 05-20-2020 01:54 AM
From: Lynn Williams
Subject: Gen 8.6 build failed
Hi Gagan,
I added /VERBOSE to this STUBLINK line in my ...\Gen\bt\scripts\build_lm_c.scr file:
===
{[IF]} EQUAL "{GUI}" "GUI"
STUBLINK=/NOLOGO /SUBSYSTEM:WINDOWS -entry:WinMainCRTStartup -out:"{LOC.CODE_EXE}{execunit.MEMBER}.EXE" {OPT.IEFLINK} /DELAYLOAD:WRGN.DLL
{[ELSE]}
...
===
->
===
{[IF]} EQUAL "{GUI}" "GUI"
STUBLINK=/VERBOSE /NOLOGO /SUBSYSTEM:WINDOWS -entry:WinMainCRTStartup -out:"{LOC.CODE_EXE}{execunit.MEMBER}.EXE" {OPT.IEFLINK} /DELAYLOAD:WRGN.DLL
{[ELSE]}
...
===
Per attached GUIMENU.out it showed me that sprintf is resolved from library ucrt.lib which is loaded from directory "C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x86\"
Per my previous post that directory is in my LIB environment variable after running "%VS140COMNTOOLS%\vsvars32.bat" from a command prompt.
If you do not see it then perhaps your VS 2015 install needs more options selected?
Hope that helps
Regards,
Lynn
------------------------------
Lynn Williams
Senior Principal Support Engineer
Broadcom
Australia
Original Message:
Sent: 05-20-2020 01:22 AM
From: Lynn Williams
Subject: Gen 8.6 build failed
Hi Gagan,
Although it may not be relevant to the problem, comparing my output to yours I noticed you have a "/DELAYLOAD:WRGN.DLL" for the link where I do not.
I am using the vanilla Gen 8.6 Free version downloaded from the recent published BOX link on this thread:
Is free version of CA Gen 8.6 still available?
https://ent.box.com/s/uixctqy2ff46v5lb593xad1jbdn7cu1j
In my file ...\Gen\bt\scripts\build_lm_c.scr I do not see any reference to "/DELAYLOAD:WRGN.DLL" but I do in the corresponding files in my standard Gen 8.6 installs from GA upwards,
Have you perhaps installed a Gen 8.6 PTF on top of the Free version?
I am not sure if that is actually supported, but anyway I did successfully install the Gen 8.6 Complete PTF WKS86200 on to my Free version but it still did not impact my successful link per attached.
Strangely also if I take legacy_stdio_definitions.lib out of the directory C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib it still does not impact my link success, so now I am even more confused :)
https://docs.microsoft.com/en-us/cpp/porting/visual-cpp-change-history-2003-2015?view=vs-2019#stdio_and_conio
Regards,
Lynn
------------------------------
Lynn Williams
Senior Principal Support Engineer
Broadcom
Australia
Original Message:
Sent: 05-19-2020 10:00 PM
From: Lynn Williams
Subject: Gen 8.6 build failed
Hi Gagan,
I tried to recreate your problem using the Gen 8.6 Free version on a Windows 10 Enterprise VM with Visual Studio Professional 2015 (with Update 3) installed.
I don't have a DB2 client installed so I just generated the Windows Packaged GUIMENU load module and all sub-components for ODBC which should produce the same error because like your example for STUBDB2N.OBJ, STUBODBN.OBJ which refers to sprintf is copied to STUBN.OBJ which is then linked - see attached GUIMENU.OUT file which shows no error.
The Build Tool uses its script callvsvars.scr to setup the VS environment variables by calling "%VS140COMNTOOLS%\vsvars32.bat" where VS140COMNTOOLS is the environment variable created after VS 2015 install.
When I ran the same "%VS140COMNTOOLS%\vsvars32.bat" manually from a command prompt my LIB was changed as follows:
===,
C:\Users\Administrator>echo %LIB%
C:\Users\Administrator>"%VS140COMNTOOLS%\vsvars32.bat"
C:\Users\Administrator>echo %LIB%
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB;C:\Program Files (x86)\Windows Kits\10\lib\10.0.10240.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1\lib\um\x86;C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x86;
===
As you see "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB;" is in the LIB environment variable and thus legacy_stdio_definitions.lib from that directory should automatically get pulled in at link time.
You might also want to run that command manually, but if it gives the same result it is difficult understand why you are encountering the problem.
Regards,
Lynn
------------------------------
Lynn Williams
Senior Principal Support Engineer
Broadcom
Australia
Original Message:
Sent: 05-19-2020 07:15 PM
From: Lynn Williams
Subject: Gen 8.6 build failed
Thanks Andy,
Gagan, also just a reminder that for LOC.EXTERNAL_LIB you will also need to put double quotes round the full path to legacy_stdio_definitions.lib due to the spaces in directory names C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib
https://techdocs.broadcom.com/content/broadcom/techdocs/us/en/ca-mainframe-software/devops/ca-gen/8-6/developing/working-with-build-tool/profile-token-descriptions/additional-tokens-for-c-applications.html
------------------------------
Lynn Williams
Senior Principal Support Engineer
Broadcom
Australia
Original Message:
Sent: 05-19-2020 03:55 PM
From: Andy Hébert
Subject: Gen 8.6 build failed
Gagan,
In addition to Lynn's reply, did you fully qualify the path for legacy_stdio_definitions.lib in LOC.EXTERNAL_LIB?
Cheers,
Andy Hebert
Principal Support Engineer
------------------------------
Principal Support Engineer
Broadcom
Original Message:
Sent: 05-19-2020 04:35 AM
From: Gagan Kakkar
Subject: Gen 8.6 build failed
Hi Lynn,
Thank you for your reply.
Found legacy_stdio_definitions.lib in C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib
Added the above to BT profile token LOC.EXTERNAL_LIB. Still the same error. :(
...Linking Load Module stub GUIMENU...Linking Load Module stub GUIMENU link /NOLOGO /SUBSYSTEM:WINDOWS -entry:WinMainCRTStartup -out:"C:\Users\Gagan\Documents\CA\Gen8.6\Models\sample.ief\c\GUIMENU.EXE" /DELAYLOAD:WRGN.DLL "C:\Users\Gagan\Documents\CA\Gen8.6\Models\sample.ief\c\OBJC\STUB.OBJ" "C:\Users\Gagan\Documents\CA\Gen8.6\Models\sample.ief\c\OBJC\STUBMAIN.OBJ" "C:\Users\Gagan\Documents\CA\Gen8.6\Models\sample.ief\c\STUB.RES" @"C:\Users\Gagan\Documents\CA\Gen8.6\Models\sample.ief\c\STUB.LNK"STUB.OBJ : error LNK2019: unresolved external symbol _sprintf referenced in function _C4ERRMSGC:\Users\Gagan\Documents\CA\Gen8.6\Models\sample.ief\c\GUIMENU.EXE : fatal error LNK1120: 1 unresolved externalsNMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.EXE"' : return code '0x460'Stop.
Thanks.
Gagan
------------------------------
IT Consultant - CA Gen
Infosys - AIB
Original Message:
Sent: 05-19-2020 03:33 AM
From: Lynn Williams
Subject: Gen 8.6 build failed
Hi Gagan,
C4ERRMSG is a function in the STUBN.C file which references sprintf.
It looks like your LIB environment variable is not picking up the MS library that contains that function.
The LIB and other environment variables required for build should be automatically setup when the build starts based on the VS version installed.
We have seen the same error before for EAB links failing when the full path for 'legacy_stdio_definitions.lib' needed to be added to BT profile token LOC.EXTERNAL_LIB.
So if you can find that library on the machine that could be a workaround for this problem.
Other users or my colleagues may have more detailed suggestions overnight. I will review again tomorrow for you.
Regards,
Lynn
------------------------------
Lynn Williams
Senior Principal Support Engineer
Broadcom
Australia
Original Message:
Sent: 05-19-2020 02:20 AM
From: Gagan Kakkar
Subject: Gen 8.6 build failed
Hi,
Getting this build failed error using Gen 8.6 (Free) on WIndows 10 Pro with VS 2015.
...Linking Load Module stub GUIMENU...Linking Load Module stub GUIMENU link /NOLOGO /SUBSYSTEM:WINDOWS -entry:WinMainCRTStartup -out:"C:\Users\Gagan\Documents\CA\Gen8.6\Models\sample.ief\c\GUIMENU.EXE" /DELAYLOAD:WRGN.DLL "C:\Users\Gagan\Documents\CA\Gen8.6\Models\sample.ief\c\OBJC\STUB.OBJ" "C:\Users\Gagan\Documents\CA\Gen8.6\Models\sample.ief\c\OBJC\STUBMAIN.OBJ" "C:\Users\Gagan\Documents\CA\Gen8.6\Models\sample.ief\c\STUB.RES" @"C:\Users\Gagan\Documents\CA\Gen8.6\Models\sample.ief\c\STUB.LNK"STUB.OBJ : error LNK2019: unresolved external symbol _sprintf referenced in function _C4ERRMSGC:\Users\Gagan\Documents\CA\Gen8.6\Models\sample.ief\c\GUIMENU.EXE : fatal error LNK1120: 1 unresolved externalsNMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\link.EXE"' : return code '0x460'Stop.**************************** Link step for STUB.EXE using C:\Users\Gagan\Documents\CA\Gen8.6\Models\sample.ief\c\STUB.LNK failed with errors. **************************** File Not FoundIEFSIGNAL:FAIL*** Build for Load Module GUIMENU Failed. ***
Complete .OUT file attached.
Thanks.
Gagan
------------------------------
IT Consultant - CA Gen
Infosys - AIB
------------------------------