Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linking more than 13 objects

Status
Not open for further replies.

ishu

Technical User
Dec 19, 2001
1
IN
we are implementing a project using cobol(micro focus) now while compling the files if your cobol program is making call so many other programs you have to mention all of them while linking your main (calling) programs at the DOS prompt as 'link main.obj+.....+' etc. In our application there are 18 such programs but when we try to link them it is not allowing us to link more than 13 objects . please send me the solution as soon as possible.


 
There are limits on a static link but there are other types of linking methods. Personally I think BUILD is the best method. Here is a bat file to do a build of all GNT's in the current directory (you will need to compile to GNT's first).

@ECHO OFF
IF "%1"=="" GOTO ERROR
REM ******************************************************************
REM * BUILDING A MICRO FOCUS APPLICATION
REM ******************************************************************
REM * This will perform the following functions.
REM * 1. Puts all GNT names in BATCH.LBT
REM * 2. Make a library using BATCH.LBT.
REM * 3. Build a Configuration file naming the application library.
REM * 4. Build the application trigger executables.
REM ******************************************************************
ECHO ** STEP 1 ** Creating GNT names for library response file
DIR *.GNT /B/O > BATCH.LBT
TYPE BATCH.LBT
PAUSE
ECHO ** STEP 2 ** Building the library...
RUN library BATCH.LBT = %1.LBR
PAUSE
ECHO ** STEP 3 ** Building the Configuration file...
ECHO [%1-PROGRAMS] > %1.CFG
ECHO %1.LBR >> %1.CFG
ECHO TOOLS.LBR >> %1.CFG
ECHO UTILS.LBR >> %1.CFG
ECHO PANELS2.GNT >> %1.CFG
TYPE %1.CFG
PAUSE
ECHO ** STEP 4 ** Creating the trigger executables...
RUN BUILD %1 /c %1.CFG /t %1 /w %1.EXE /i TOOLS.LBR
PAUSE
:INFO
ECHO ******************************************************
ECHO In addition to your application library, configuration
ECHO file and trigger you will also need to distribute some
ECHO runtime files. See documentation for details.
ECHO ******************************************************
PAUSE
GOTO END
:ERROR
ECHO ****************************************
ECHO Does a Micro Focus Build of all GNTs
ECHO in the current directory.
ECHO ****************************************
ECHO Parameter(s)...
ECHO 1 = Application Name
:END
 
p.s
You could name the bat file BUILDAPP.BAT and the application name would be the name of the main driving program.

you can also automate the compiles with these 2 bat files:

COMPALLG.BAT
@ECHO OFF
FOR %%I IN (*.CBL) DO CALL COMPGNT %%I
GOTO END
:ERROR
ECHO ****************************************
ECHO Compiles all COBOL programs in the curr
ECHO directory to GNTs. Uses COMPGNT.BAT/CMD.
ECHO ****************************************
ECHO Parameter(s)...
ECHO Non Required
:END

and

COMPGNT.BAT
@ECHO OFF
IF "%1"=="" GOTO ERROR
ECHO COMPILING %1 TO GNT
COBOL %1 NOQUERY OMF(GNT) NOBOUND;
GOTO END
:ERROR
ECHO ****************************************
ECHO Compiles a COBOL program to a GNT using
ECHO default Micro Focus directives.
ECHO ****************************************
ECHO Parameter(s)...
ECHO 1 = Program Name
:END
 
Another alternative is to use the LIB command to put the obj files in a library. Then you can link with the LIB instead of the individual OBJ files.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top