From: cycjec on

I've been trying to get OpenCobol to run on Linux.
It finds errors and when I correct all of them it doesn't
compile it. (I'll see e-mail msgs sent to same ID AT
freeshell DOT org quicker BTW)


Per the FAQ I've been doing:



$ cobc -x hellow.cob

This is what I get:


/usr/bin/ld: skipping incompatible /home/opencobol/programs/lib/libcob.so when searching for -lcob
/usr/bin/ld: skipping incompatible /home/opencobol/programs/lib/libcob.a when searching for -lcob
/usr/bin/ld: skipping incompatible /home/opencobol/programs/lib/libcob.so when searching for -lcob
/usr/bin/ld: skipping incompatible /home/opencobol/programs/lib/libcob.a when searching for -lcob
/usr/bin/ld: skipping incompatible /home/opencobol/programs/lib/libcob.so when searching for -lcob
/usr/bin/ld: skipping incompatible /home/opencobol/programs/lib/libcob.a when searching for -lcob
/usr/bin/ld: cannot find -lcob


collect2: ld returned 1 exit status

The Hello World code is:


*89012*******************************************
*************************************************

IDENTIFICATION DIVISION.
PROGRAM-ID. POP-HELLO.
*THIS PROGRAM PRINTS HELLO TO THE CONSOLE *

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

ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT GREETING-LINE ASSIGN TO console.

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

DATA DIVISION.
FILE SECTION.

FD GREETING-LINE.
01 OUTPUT-LINE PIC X(20).

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

PROCEDURE DIVISION.
DO-STUFF.
OPEN OUTPUT GREETING-LINE
MOVE "HELLO" TO OUTPUT-LINE
WRITE OUTPUT-LINE
MOVE " WORLD" TO OUTPUT-LINE
WRITE OUTPUT-LINE
CLOSE GREETING-LINE
STOP RUN.

From: Richard on
On Nov 17, 9:47 pm, <cyc...(a)yahoo.com> wrote:
>  I've been trying to get OpenCobol to run on Linux.
>  It finds errors and when I correct all of them it doesn't
>  compile it.   (I'll see e-mail msgs sent to same ID AT
>  freeshell DOT org quicker BTW)
>
>  Per the  FAQ I've been doing:
>
> $ cobc -x hellow.cob
>
>   This is what I get:
>
> /usr/bin/ld: skipping incompatible /home/opencobol/programs/lib/libcob.so when searching for -lcob
> /usr/bin/ld: skipping incompatible /home/opencobol/programs/lib/libcob.a when searching for -lcob
> /usr/bin/ld: skipping incompatible /home/opencobol/programs/lib/libcob.so when searching for -lcob
> /usr/bin/ld: skipping incompatible /home/opencobol/programs/lib/libcob.a when searching for -lcob
> /usr/bin/ld: skipping incompatible /home/opencobol/programs/lib/libcob.so when searching for -lcob
> /usr/bin/ld: skipping incompatible /home/opencobol/programs/lib/libcob.a when searching for -lcob
> /usr/bin/ld: cannot find -lcob
>
> collect2: ld returned 1 exit status

The program compiles correctly and then is trying to build an
executable with 'ld' but finds and older libcob.a.

Have you previously loaded older versions of OpenCOBOL onto your
machine ? Where were those older programs installed ? Where is this
newer version installed ? What does 'set' tell you about where
libraries will be searched for ?


From: C.Y.C.J.E.C on
Richard <riplin(a)azonic.co.nz> did resolve perplexity thusly:

>> collect2: ld returned 1 exit status

> The program compiles correctly and then is trying to build an
> executable with 'ld' but finds and older libcob.a.

Thank you.