[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[open-cobol-list] problem with linking and execution
From: |
Richard A. Painter |
Subject: |
[open-cobol-list] problem with linking and execution |
Date: |
Mon Jun 10 12:26:03 2002 |
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 |
+---------------------------------------------------------------+
* ?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.
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.
- [open-cobol-list] problem with linking and execution,
Richard A. Painter <=