gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] Re: open-cobol-list digest, Vol 1 #10 - 1 msg


From: Doug Vogel
Subject: [open-cobol-list] Re: open-cobol-list digest, Vol 1 #10 - 1 msg
Date: Mon Jun 10 13:56:02 2002


address@hidden wrote:

> Send open-cobol-list mailing list submissions to
>         address@hidden
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.sourceforge.net/lists/listinfo/open-cobol-list
> or, via email, send a message with subject or body 'help' to
>         address@hidden
>
> You can reach the person managing the list at
>         address@hidden
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of open-cobol-list digest..."
>
> Today's Topics:
>
>    1. problem with linking and execution (Richard A. Painter)
>
> --__--__--
>
> Message: 1
> Date: Mon, 10 Jun 2002 13:24:32 -0600
> From: "Richard A. Painter" <address@hidden>
> Organization: Painter Engineering, Inc.
> To: Open Cobol List <address@hidden>
> Subject: [open-cobol-list] problem with linking and execution
>
> This is a multi-part message in MIME format.
> --------------1764898509D4DF9594D328C6
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> i am running cobc 0.9.5.92
>
> the attached 2 cobol files: program2.cob calls program3.cob.
> however i can't get program2 to execute.  here are the methods i have tried:
>
>         1. cobc -static -c PROGRAM3.cob
>            cobc -static -c -m PROGRAM2.cob
>            cobc -o program2 PROGRAM2.o PROGRAM3.o
>
>            all that executes is program3 and not the top-level program2
>
>         2. cobc -static -C PROGRAM3.cob
>            cobc -static -C -m PROGRAM2.cob
>            gcc -c -O `cob-config --cflags` PROGRAM2.c PROGRAM3.c
>            gcc -o program2 PROGRAM2.o PROGRAM3.o `cob-config --libs`
>
>            same as #1, all that executes is program3 and not the top-level 
> program2
>
>         3. if i leave the -m off i get "multiple main defined" and the link 
> fails.
>
> examining the .c code from #1 appears to look ok.  program2.c has a main and
> program3 does not.
>
> r
> --
>
> +---------------------------------------------------------------+
> | Richard A. Painter            Phone 719 495 7054              |
> | Painter Engineering, Inc.     Mailto:address@hidden       |
> | 8470 Swan Rd.                                                 |
> | Black Forest, CO 80908                                        |
> |                                                               |
> | Visit our Web site:         http://painter.inc                |
> |         http://home.earthlink.net/~painterengineering         |
> |                                                               |
> | Systems & Software Engineering + LAN WAN Networking + X.25    |
> | INTERNET TCP-IP + Real-time Transaction Processing            |
> | System & Software Integration, Testing, Verification & Audits |
> | Web Hosting & Design + Apache + PHP + modSSL + cURL           |
> | Database Design & Applications + Oracle                       |
> | Benchmarks + Course & Workshop Development & Delivery         |
> | Financial and Medical Software Integration + Security         |
> | Middleware + EDI + Cryptography + Firewalls                   |
> | UNIX + Linux + Windows                                        |
> |                                                               |
> | What is popular is not always right and what is right is not  |
> | always popular.     - Howard Cosell                           |
> |                                                               |
> | Chance favors the prepared mind!   Illegitima non carborundum |
> +---------------------------------------------------------------+
> --------------1764898509D4DF9594D328C6
> Content-Type: text/plain; charset=us-ascii;
>  name="PROGRAM2.cob"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline;
>  filename="PROGRAM2.cob"
>
>       * ?SAVE ALL
>       * ?SYMBOLS,INSPECT,OPTIMIZE 2
>       * ?ANSI;NOBLANK
>        IDENTIFICATION DIVISION.
>        PROGRAM-ID. PROGRAM2.
>        ENVIRONMENT DIVISION.
>        INPUT-OUTPUT SECTION.
>        FILE-CONTROL.
>        DATA DIVISION.
>        WORKING-STORAGE SECTION.
>        01  ws-field1            pic x(10).
>        PROCEDURE DIVISION.
>        0000-MAINLINE.
>            display 'CALLING PROGRAM 3 1ST TIME'
>            CALL 'PROGRAM3'
>            display 'CALLING PROGRAM 3 2ND TIME'
>            CALL 'PROGRAM3'
>            exit program.
>
> --------------1764898509D4DF9594D328C6
> Content-Type: text/plain; charset=us-ascii;
>  name="PROGRAM3.cob"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline;
>  filename="PROGRAM3.cob"
>
>        IDENTIFICATION DIVISION.
>        PROGRAM-ID. PROGRAM3.
>        ENVIRONMENT DIVISION.
>        INPUT-OUTPUT SECTION.
>        FILE-CONTROL.
>        DATA DIVISION.
>        WORKING-STORAGE SECTION.
>        01  ws-field1            pic x(10) VALUE SPACES.
>        PROCEDURE DIVISION.
>        0000-MAINLINE.
>            DISPLAY 'FIELD = ' WS-FIELD1
>            MOVE 'DOUG VOGEL' TO WS-FIELD1
>            exit program.
>
> --------------1764898509D4DF9594D328C6--
>
> --__--__--
>
> _______________________________________________
> open-cobol-list mailing list
> address@hidden
> https://lists.sourceforge.net/lists/listinfo/open-cobol-list
>
> End of open-cobol-list Digest
000100 IDENTIFICATION DIVISION.                                         00010000
000200 PROGRAM-ID. PROGRAM3.                                            00020000
009900 ENVIRONMENT DIVISION.                                            00690000
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
010000 DATA DIVISION.                                                   00700000
010100 WORKING-STORAGE SECTION.                                         00710000
       01  ws-field1            pic x(10) VALUE SPACES. 
       linkage section.
       01  ws-dummy-field       pic x(10).
       PROCEDURE DIVISION.
025800 0000-MAINLINE using ws-dummy-field.                                      
          
           DISPLAY 'FIELD = ' WS-FIELD1
           MOVE 'DOUG VOGEL' TO WS-FIELD1 
           exit program.                                                02021000

000100 IDENTIFICATION DIVISION.                                         00010000
000200 PROGRAM-ID. PROGRAM2.                                            00020000
009900 ENVIRONMENT DIVISION.                                            00690000
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
010000 DATA DIVISION.                                                   00700000
010100 WORKING-STORAGE SECTION.                                         00710000
       01  ws-field1            pic x(10).
       01  ws-dummy-field       pic x(10).
       PROCEDURE DIVISION.
025800 0000-MAINLINE.                                                   01970000
           display 'CALLING PROGRAM 3 1ST TIME'
           CALL 'PROGRAM3' using ws-dummy-field
           display 'CALLING PROGRAM 3 2ND TIME'
           CALL 'PROGRAM3' using ws-dummy-field
           exit program.                                                02021000


reply via email to

[Prev in Thread] Current Thread [Next in Thread]