Gen EDGE

 View Only
Expand all | Collapse all

Gen 8.6 build failed

  • 1.  Gen 8.6 build failed

    Posted May 19, 2020 02:21 AM
      |   view attached

    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
    ------------------------------

    Attachment(s)

    rar
    GUIMENU.rar   1 KB 1 version


  • 2.  RE: Gen 8.6 build failed

    Broadcom Employee
    Posted May 19, 2020 03:33 AM
    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
    ------------------------------



  • 3.  RE: Gen 8.6 build failed

    Posted May 19, 2020 04:35 AM

    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
    ------------------------------



  • 4.  RE: Gen 8.6 build failed

    Broadcom Employee
    Posted May 19, 2020 03:56 PM
    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
    ------------------------------



  • 5.  RE: Gen 8.6 build failed

    Broadcom Employee
    Posted May 19, 2020 07:15 PM
    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
    ------------------------------



  • 6.  RE: Gen 8.6 build failed

    Broadcom Employee
    Posted May 19, 2020 10:01 PM
      |   view attached
    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
    ------------------------------

    Attachment(s)

    zip
    GUIMENU.zip   3 KB 1 version


  • 7.  RE: Gen 8.6 build failed

    Broadcom Employee
    Posted May 20, 2020 01:23 AM
    Edited by Lynn Williams May 20, 2020 01:40 AM
      |   view attached

    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
    ------------------------------

    Attachment(s)



  • 8.  RE: Gen 8.6 build failed

    Broadcom Employee
    Posted May 20, 2020 01:54 AM
      |   view attached
    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
    ------------------------------

    Attachment(s)



  • 9.  RE: Gen 8.6 build failed

    Posted May 20, 2020 02:24 AM

    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
    ------------------------------



  • 10.  RE: Gen 8.6 build failed

    Broadcom Employee
    Posted May 20, 2020 02:54 AM
    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=309563

    ASP.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
    ------------------------------



  • 11.  RE: Gen 8.6 build failed

    Posted May 20, 2020 03:10 AM
      |   view attached

    Hi Lynn,

    Attached is .out file after adding /VERBOSE.

    Thanks.
    Gagan



    ------------------------------
    IT Consultant - CA Gen
    Infosys - AIB
    ------------------------------

    Attachment(s)

    rar
    GUIMENU.rar   5 KB 1 version


  • 12.  RE: Gen 8.6 build failed

    Broadcom Employee
    Posted May 21, 2020 02:28 AM
    Hi Gagan,
    In your GUIMENU.out  see no reference for sprintf aside from the unresolved external symbol ine
    I am thinking this could be a stub object related.problem
    As a test I backed up my STUBODBN.OBJ and replaced it with a copy of STUBDB2N.OBJ
    I still generated/built for ODBC.
    When my new STUBODBN.OBJ was copied to STUB.OBJ and linked I received expected unresolved externals for sql variables because I don't have the DB2 libraries. However I also received one for sprintf
    STUB.OBJ : error LNK2019: unresolved external symbol _sprintf referenced in function _C4ERRMSG

    1. Can you confirm if the problem does not occur when you generate/build for ODBC?

    2. If problem does not occur for ODBC you can try to force compile the STUBs by setting BT C Profile token OPT.BUILD_SRC to YES
    Then try again for DB2. (Maybe a precompile & compile of the DB2 stub STUBDB2N.SQC to new STUBDB2N.OBJ might fix it)

    Regards,

    Lynn

    ------------------------------
    Lynn Williams
    Senior Principal Support Engineer
    Broadcom
    Australia
    ------------------------------



  • 13.  RE: Gen 8.6 build failed

    Posted May 21, 2020 05:32 AM
      |   view attached

    Hi Lynn,

    Yes, I noticed that in my GUIMENU.out there is no reference to sprintf.

    I removed all other windows kits. Now I have 10.0.10240.0. But still the same error.  GUIMENU.out attached.

    I will try what you have suggested above and let you know. The frustrating thing for me is that I had very similar setup working before but had to rebuild my laptop and now can't get this working.

    Thanks.

    Gagan



    ------------------------------
    IT Consultant - CA Gen
    Infosys - AIB
    ------------------------------

    Attachment(s)

    rar
    GUIMENU.rar   5 KB 1 version


  • 14.  RE: Gen 8.6 build failed

    Posted May 21, 2020 12:54 PM
      |   view attached

    Hi Lynn,

    Tried a few more things :.

    The problem does not occur when I generate/build for ODBC.

    Then even after setting BT C Profile token OPT.BUILD_SRC to YES build for Db2 gives me the same error message. (GUIMENU.out attached) 

    Now I have the same windows kit 10.0.10240.0. Not sure what's the issue is. 

    Thanks.

    Gagan



    ------------------------------
    IT Consultant - CA Gen
    Infosys - AIB
    ------------------------------

    Attachment(s)

    zip
    GUIMENU.zip   6 KB 1 version


  • 15.  RE: Gen 8.6 build failed

    Broadcom Employee
    Posted May 22, 2020 02:13 AM
    H Gagan,
    At this stage I have no further suggestions, but I will keep researching when I have a chance.
    I will also try to install DB2 for Windows next week to see if I can recreate the problem.
    If I can manage to do that install and recreate the problem then it would confirm it is not specific to your environment.

    In the meantime you could use ODBC as a workaround to create a Gen GUI application that can work with your DB2 database via a 32-bit ODBC DSN.

    Regards,

    Lynn

    ------------------------------
    Lynn Williams
    Senior Principal Support Engineer
    Broadcom
    Australia
    ------------------------------



  • 16.  RE: Gen 8.6 build failed

    Posted May 22, 2020 03:37 AM
    Thank Lynn.
    Yes, for the time being I will use ODBC. 
    BTW, I wonder if there is any issue with the Gen vesrion I have. Do you know where can I get the latest installation files for the same ?

    Thanks.
    Regards,
    Gagan

    ------------------------------
    IT Consultant - CA Gen
    Infosys - AIB
    ------------------------------



  • 17.  RE: Gen 8.6 build failed

    Posted May 22, 2020 07:10 AM

    Hi Lynn,

    It's working now but with this workaround:

    Added : #include <stdio.h> in C:\Program Files (x86)\CA\Gen86Free\Gen\STUBDB2N.SQC

    Thanks.

    Gagan



    ------------------------------
    IT Consultant - CA Gen
    Infosys - AIB
    ------------------------------



  • 18.  RE: Gen 8.6 build failed

    Broadcom Employee
    Posted May 24, 2020 09:07 PM
    Edited by Lynn Williams May 24, 2020 09:14 PM
    Hi Gagan,
    Glad to hear that you found that workaround. 
    After I checking my GEN 8.6 standard install with Gen 8.6 Complete PTF WKS86200 applied I found that STUBDB2N.SQC has "#include <stdio.h>", but the original version backed up in the directory ...\PTF_Backups\WKS86200.BAK\Gen_Backups\Gen does not have it. The Gen 8.6 Free version also of course does not have it.
    That change came in with PTF RO98577 / RTN86106 which was released after 8.6 IR1 and is included in Gen 8.6 Complete PTF WKS86200:
    https://support.broadcom.com/download-center/solution-detail.html?aparNo=RO98577&os=WINDOWS
    As you see it was reported when BUILD_SRC was set to YES to force a precompile and compile of the stub, but maybe the link problem could also be encountered with BUILD_SRC=NO, because the default STUBODBN.OBJ would also have no reference to stdio.h.
    I note that STUBODBN.OBJ does reference stdio.h in the WKS86200 version (all STUB sources and objects provided in that version reference stdio.h).
    I suspect that when you had your setup working before your laptop rebuild, you had enough PTFs installed OR you had Gen 8.6 Complete PTF WKS86200 installed so you did not hit the problem.

    Ongoing if you have GEN license entitlement I would suggest that, instead of using the Gen 8.6 Free edition, you log in to the support portal and download and install the licensed version from here:
    https://support.broadcom.com/download-center/product-download.html?subfamily=GEN 
    -> CA Gen Workstation Developer Toolset WINDOWS-ALL
    Then install the latest PTFs from the "CA Gen 8.6 Solutions & Patches" page located here:
    https://techdocs.broadcom.com/us/product-content//recommended-reading/technical-document-index/ca-gen-8_6-solutions---patches.html
    Hope that helps

    Regards,

    Lynn

    ------------------------------
    Lynn Williams
    Senior Principal Support Engineer
    Broadcom
    Australia
    ------------------------------



  • 19.  RE: Gen 8.6 build failed

    Broadcom Employee
    Posted May 25, 2020 12:10 AM
    Edited by Lynn Williams May 25, 2020 12:12 AM
    Hi Gagan,
    I also managed to get DB2 for Windows installed and I could recreate the problem with licensed Gen 8.6 GA for both BUILD_SRC=NO and BUILD_SRC=YES.
    After I installed WKS86200 using BUILD_SRC=NO still showed the error, but using BUILD_SRC=YES then resolved the problem.
    So the STUBODBN.OBJ delivered with WKS86200 still seems to have a problem and it first needs to be rebuilt via precompile of STUBODBN.SQC + compile, which is achieved by using BUILD_SRC=YES.

    Regards,

    Lynn


    ------------------------------
    Lynn Williams
    Senior Principal Support Engineer
    Broadcom
    Australia
    ------------------------------



  • 20.  RE: Gen 8.6 build failed

    Broadcom Employee
    Posted May 25, 2020 02:51 AM
    Hi Gagan,
    I also decided to create a new KB article to cover it should anyone come across it again:
    Gen 8.6 sample model build of GUIMENU for DB2 UDB gives "LNK2019: unresolved external symbol _sprintf referenced in function _C4ERRMSG"

    Regards,

    Lynn

    ------------------------------
    Lynn Williams
    Senior Principal Support Engineer
    Broadcom
    Australia
    ------------------------------



  • 21.  RE: Gen 8.6 build failed

    Posted May 26, 2020 11:05 AM
    Hi Lynn,

    Thank you !!

    Regards,
    Gagan

    ------------------------------
    IT Consultant - CA Gen
    Infosys - AIB
    ------------------------------