yogo
yogo

Reputation: 47

How do I create an executable file with OpenCOBOL?

Upon finishing a COBOL program, how do I compile it into an executable file that may be run on other PCs? I'm using OpenCOBOL via cygwin.

Upvotes: 0

Views: 2700

Answers (2)

Brian Tiffin
Brian Tiffin

Reputation: 4116

If you compile with Cygwin, the target computers also need Cygwin, or in particular the cygwin dynamic libraries along with the OpenCOBOL runtimes.

Many times, you can also compile under MinGW, which lessens the dependencies, but also lessens the available POSIX features.

Easiest path, install OpenCOBOL and Cygwin on the target machines, and you'll be good to go, otherwise you'll need to produce release packages with all the dependencies and instructions for PATH settings.

Upvotes: 0

Jeff B
Jeff B

Reputation: 8982

Check out this getting started page from the user manual for OpenCOBOL:

But in case the link is broken, just do this:

$ cobc -x hello.cob
$ ./hello

cobc is the compiler. hello.cob is the source file. The output is simply the file hello which can be run by calling ./hello. The -x option is necessary to build an executable.

However, with all compiled programs, it is compiled for the machine is was built on. It will work on machine with similar architectures, but you don't true cross-platform ability unless you're using an interpreted language like Python or Java.

Upvotes: 1

Related Questions