Gen EDGE

  • 1.  Rebuilding DBMS DLLs and Executables

    Posted Aug 21, 2017 08:22 AM

    I'm trying to rebuild 32-bit version Oracle DLLs using mkdbs.bat
    My environment is as Follows:
    I'm using Ca gen 8.6 on Windows 7 64-bit professional,
    Visual studio 2013, and Oracle 11g 32-bit

    %ORACLE_HOME% environment variable is set to the correct location.

     

    I edited mkdbs.bat to set the compiler as follows:
            
            set COMPILER_VER=VS120

     

    When I run
            mkdbs.bat oracle11

     

    I got an error as follows:

     

    ********************************************************************
    MKDBS: CA Gen DBMS DLL Rebuilder

     

    MKDBS: Saving original database dll in subdirectory

     

    MKDBS: Rebuilding the database loader prior to rebuilding the database dll

     

    MAKEDDL: CA Gen DDL Loader Support

     

    MAKEDDL: Saving original database loader in subdirectory

     

    MAKEDDL: Making new version of database loader

     

    BUILDNO.BAT: CA Gen BUILDNO.H update file
        rc /dtioraddl /fotioraddl.res /I"C:\Gen86\gen\version" /I"C:\Gen86\gen\version" "C:\Gen86\gen\version\generic.rc"
    Microsoft (R) Windows (R) Resource Compiler Version 6.2.9200.20789Copyright (C) Microsoft Corporation.  All rights reserved.
    C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE\afxres.h(17) : fatal error RC1015: cannot open include file 'winres.h'.
    MAKEDDL: MAKE Failed to Complete

     

    MKDBS: Returning to mkdbs.bat

     

    MKDBS: Compiling the database dll modules
    tiroconn.c
    tirora.c
    tirora.c(305) : warning C4273: 'getenv' : inconsistent dll linkage
            C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\stdlib.h(462) : see previous definition of 'getenv'

     

    MKDBS: Relinking the database dll
    Microsoft (R) Windows (R) Resource Compiler Version 6.2.9200.20789Copyright (C) Microsoft Corporation.  All rights reserved.
    C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\ATLMFC\INCLUDE\afxres.h(17) : fatal error RC1015: cannot open include file 'winres.h'.LINK : fatal error LNK1181: cannot open input file 'orasql11.lib'

     

    MKDBS: Link of aecoran.dll failed
    MKDBS: Possible cause could be improper setting of the LIB environment variable.
    ECHO is off.
    ********************************************************************

     

    when I searched for "winres.h",  I found it located in

     

    "C:\Program Files (x86)\Windows Kits\8.0\Include\um"

     

    I edited mkdbs.bat to include the folder above as follows:

     

    set INCLUDE=%INCLUDE%;C:\Program Files (x86)\Windows Kits\8.0\Include\um

     


    Run

     

        mkdbs.bat oracle11
    again, I got another error as follows

     

    ********************************************************************

     

    MKDBS: CA Gen DBMS DLL Rebuilder

     

    MKDBS: Saving original database dll in subdirectory

     

    MKDBS: Rebuilding the database loader prior to rebuilding the database dll

     

    MAKEDDL: CA Gen DDL Loader Support

     

    MAKEDDL: Saving original database loader in subdirectory

     

    MAKEDDL: Making new version of database loader

     

    BUILDNO.BAT: CA Gen BUILDNO.H update file
        rc /dtioraddl /fotioraddl.res /I"C:\Gen86\gen\version" /I"C:\Gen86\gen\version" "C:\Gen86\gen\version\generic.rc"
    Microsoft (R) Windows (R) Resource Compiler Version 6.2.9200.20789Copyright (C) Microsoft Corporation.  All rights reserved.
    C:\Program Files (x86)\Windows Kits\8.0\Include\um\dlgs.h(1) : fatal error RC1015: cannot open include file 'winapifamily.h'.
    MAKEDDL: MAKE Failed to Complete

     

    MKDBS: Returning to mkdbs.bat

     

    MKDBS: Compiling the database dll modules
    tiroconn.c
    tirora.c
    tirora.c(305) : warning C4273: 'getenv' : inconsistent dll linkage
            C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\stdlib.h(462) : see previous definition of 'getenv'

     

    MKDBS: Relinking the database dll
    Microsoft (R) Windows (R) Resource Compiler Version 6.2.9200.20789Copyright (C) Microsoft Corporation.  All rights reserved.
    C:\Program Files (x86)\Windows Kits\8.0\Include\um\dlgs.h(1) : fatal error RC1015: cannot open include file 'winapifamily.h'.LINK : fatal error LNK1181: cannot open input file 'orasql11.lib'

     

    MKDBS: Link of aecoran.dll failed
    MKDBS: Possible cause could be improper setting of the LIB environment variable.
    ECHO is off.

     

    ********************************************************************
    when I searched for 'winapifamily.h' I found it located in

     

    "C:\Program Files (x86)\Windows Kits\8.0\Include\shared"

     

    I edited mkdbs.bat to include the folder above as follows:

     

    set INCLUDE=%INCLUDE%;C:\Program Files (x86)\Windows Kits\8.0\Include\um
    set INCLUDE=%INCLUDE%;C:\Program Files (x86)\Windows Kits\8.0\Include\shared

     


    Run

     

        mkdbs.bat oracle11

     

    again, I got another error as follows

     

    ********************************************************************

    MKDBS: CA Gen DBMS DLL Rebuilder

     

    MKDBS: Saving original database dll in subdirectory

     

    MKDBS: Rebuilding the database loader prior to rebuilding the database dll

     

    MAKEDDL: CA Gen DDL Loader Support

     

    MAKEDDL: Saving original database loader in subdirectory

     

    MAKEDDL: Making new version of database loader

     

    BUILDNO.BAT: CA Gen BUILDNO.H update file
        rc /dtioraddl /fotioraddl.res /I"C:\Gen86\gen\version" /I"C:\Gen86\gen\version" "C:\Gen86\gen\version\generic.rc"
    Microsoft (R) Windows (R) Resource Compiler Version 6.2.9200.20789Copyright (C) Microsoft Corporation.  All rights reserved.
            1 file(s) copied.
        proc iname=tioraddl.sc oname=tioraddl.c include=C:\osama\product\11.2.0\dbhome_1\precomp\public mode=ANSI sqlcheck=syntax ltype=none > tioraddl.out 2>&1
        cl /c /Od /W3 /MD /nologo /FD /EHa  -I"C:\Gen86\gen\ddl" -IC:\osama\product\11.2.0\dbhome_1\precomp\public -Fotioraddl.obj /DMSC /DWIN32 /D_CONSOLE /D_CRT_SECURE_NO_DEPRECATE /D_MBCS tioraddl.c
    tioraddl.c
        cl tioraddl.res tioraddl.obj tidbms.lib tidbms.lib user32.lib C:\osama\product\11.2.0\dbhome_1\precomp\lib\orasql11.lib /link /SUBSYSTEM:CONSOLE /INCREMENTAL:NO /NOLOGO /DYNAMICBASE /NXCOMPAT /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /MACHINE:X86 /out:tioraddl.exe
    LINK : fatal error LNK1181: cannot open input file 'user32.lib'

     

    MAKEDDL: MAKE Failed to Complete

     

    MKDBS: Returning to mkdbs.bat

     

    MKDBS: Compiling the database dll modules
    tiroconn.c
    tirora.c
    tirora.c(305) : warning C4273: 'getenv' : inconsistent dll linkage
            C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\stdlib.h(462) : see previous definition of 'getenv'

     

    MKDBS: Relinking the database dll
    Microsoft (R) Windows (R) Resource Compiler Version 6.2.9200.20789Copyright (C) Microsoft Corporation.  All rights reserved.
    LINK : fatal error LNK1181: cannot open input file 'orasql11.lib'

     

    MKDBS: Link of aecoran.dll failed
    MKDBS: Possible cause could be improper setting of the LIB environment variable.
    ECHO is off.

     


    ********************************************************************
    Now It's a linker error

     

    when I searched for 'user32.lib' I found it located in

     

    "C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x86"

     

    I edited mkdbs.bat to include the folder above as follows:

     

    set LIB=%LIB%;C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x86

     


    Run

     

        mkdbs.bat oracle11

     

    again, I got another error as follows:

     

    ********************************************************************
    MKDBS: CA Gen DBMS DLL Rebuilder

     

    MKDBS: Saving original database dll in subdirectory

     

    MKDBS: Rebuilding the database loader prior to rebuilding the database dll

     

    MAKEDDL: CA Gen DDL Loader Support

     

    MAKEDDL: Saving original database loader in subdirectory

     

    MAKEDDL: Making new version of database loader

     

    BUILDNO.BAT: CA Gen BUILDNO.H update file
        rc /dtioraddl /fotioraddl.res /I"C:\Gen86\gen\version" /I"C:\Gen86\gen\version" "C:\Gen86\gen\version\generic.rc"
    Microsoft (R) Windows (R) Resource Compiler Version 6.2.9200.20789Copyright (C) Microsoft Corporation.  All rights reserved.
            1 file(s) copied.
        proc iname=tioraddl.sc oname=tioraddl.c include=C:\osama\product\11.2.0\dbhome_1\precomp\public mode=ANSI sqlcheck=syntax ltype=none > tioraddl.out 2>&1
        cl /c /Od /W3 /MD /nologo /FD /EHa  -I"C:\Gen86\gen\ddl" -IC:\osama\product\11.2.0\dbhome_1\precomp\public -Fotioraddl.obj /DMSC /DWIN32 /D_CONSOLE /D_CRT_SECURE_NO_DEPRECATE /D_MBCS tioraddl.c
    tioraddl.c
        cl tioraddl.res tioraddl.obj tidbms.lib tidbms.lib user32.lib C:\osama\product\11.2.0\dbhome_1\precomp\lib\orasql11.lib /link /SUBSYSTEM:CONSOLE /INCREMENTAL:NO /NOLOGO /DYNAMICBASE /NXCOMPAT /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /MACHINE:X86 /out:tioraddl.exe
    MSVCRT.lib(MSVCR120.dll) : error LNK2005: _printf already defined in tidbms.lib(tidbms.obj)
    MSVCRT.lib(MSVCR120.dll) : error LNK2005: _sprintf already defined in tidbms.lib(tidbms.obj)
    tidbms.lib(tidbms.obj) : error LNK2019: unresolved external symbol __imp____acrt_iob_func referenced in function _printf
    tidbms.lib(tidbms.obj) : error LNK2019: unresolved external symbol __imp____stdio_common_vfprintf referenced in function __vfprintf_l
    tidbms.lib(tidbms.obj) : error LNK2019: unresolved external symbol __imp____stdio_common_vsprintf referenced in function __vsnprintf_l
    tioraddl.exe : fatal error LNK1120: 3 unresolved externals

     

    MAKEDDL: MAKE Failed to Complete

     

    MKDBS: Returning to mkdbs.bat

     

    MKDBS: Compiling the database dll modules
    tiroconn.c
    tirora.c
    tirora.c(305) : warning C4273: 'getenv' : inconsistent dll linkage
            C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\stdlib.h(462) : see previous definition of 'getenv'

     

    MKDBS: Relinking the database dll
    Microsoft (R) Windows (R) Resource Compiler Version 6.2.9200.20789Copyright (C) Microsoft Corporation.  All rights reserved.
    LINK : fatal error LNK1181: cannot open input file 'orasql11.lib'

     

    MKDBS: Link of aecoran.dll failed
    MKDBS: Possible cause could be improper setting of the LIB environment variable.
    ECHO is off.
    *********************************************************************************

    Anybody have an idea to solve this problem?

     

    Thanks



  • 2.  Re: Rebuilding DBMS DLLs and Executables

    Posted Aug 21, 2017 10:18 AM

    We had a similar problem running mkdbs.bat.  It assumes you don't have the windows kits installed.  If they are installed, then the call to vsvars32.bat is changing the environment variables INCLUDE and LIB putting the windows kits before your dbms references and therefore uses those for the build.  We modified the mkdbs.bat script resetting the INCLUDE and LIB environment variables in the build section of the script before compilation is performed so that our DBMS references would be first.  Here is an example of our changes.  We were using UDB, but there is another section called ":build_oracle" where you could put similar changes for your oracle environment. 

     

      

    :build_db2


    REM BEGIN
    set INCLUDE=C:\Program Files\IBM\SQLLIB\INCLUDE;%INCLUDE%
    set LIB=C:\Program Files\IBM\SQLLIB\LIB;%LIB%
    REM  END



  • 3.  Re: Rebuilding DBMS DLLs and Executables
    Best Answer

    Broadcom Employee
    Posted Aug 21, 2017 09:52 PM

    Hi Osama,

    Per the mkdbs.bat comments the ORACLE_HOME\precomp\lib must be included in the LIB environment variable before the script is invoked. I think that is what is currently missing in your environment,

    I just tested myself using Visual Studio 2015 ("set COMPILER_VER=VS140") and the only problem I encountered was the last link error you reported (LINK : fatal error LNK1181: cannot open input file 'orasql11.lib') when I did not have ORACLE_HOME\precomp\lib set in the LIB environment variable. After doing that the problem was resolved.

    So it looks like the workaround given by Steve may only be needed for DB2

    Hope that helps.

     

    Regards,

     

    Lynn



  • 4.  Re: Rebuilding DBMS DLLs and Executables

    Posted Aug 23, 2017 05:17 AM

    Hi Lynn,

     

    I've changed the compiler to be Visual studio 2015 to match with your environment and when I ran

    MKDBS.bat  ORACLE11

     

    It gave me the same only error as yours, I included ORACLE_HOME\precomp\lib set in the LIB environment variable

    in MKDBS.bat but It gave me the same error.

    So I copied orasql11.lib to  gen folder and it compiled successfully and produced the required DLL.

     

    Thanks a lot for your help.

    Best regards,

    Osama

     



  • 5.  Re: Rebuilding DBMS DLLs and Executables

    Broadcom Employee
    Posted Aug 23, 2017 07:37 PM

    Hi Osama,

    Thanks for the update and positive news.

    For ORACLE_HOME\precomp\lib in LIB environment variable you need to replace ORACLE_HOME with the actual directory name or use %ORACLE_HOME%\precomp\lib. If you did not do that it would explain orasql11.lib not being found.

    Anyway good to hear that you got it working 

    Regards,

    Lynn



  • 6.  Re: Rebuilding DBMS DLLs and Executables

    Posted Sep 20, 2017 08:28 AM

    Thanks