Install Guide

OpenCOBOL Install Guide

Most of the instructions below are for POSIX compatible systems: Unix, GNU/Linux or Cygwin for example.

For details on Windows installation, please see

: Gary's Links (Assorted Documents and Downloads) | A fantastic assortment of information.~
Gary wrote the book on OpenCOBOL, so check these links even if you aren't doing Windows.

: Bill's Notes (Getting started with Windows) | Bill thoroughly documented getting a system up and running.~
From the point of view of an expert with big iron COBOL coming to grips with setting up OpenCOBOL on a Windows machine.


OpenCOBOL requires the following external libraries to be installed:

: GNU MP (libgmp) 4.1.2 or later |
libgmp is used to implement decimal arithmetic.~
GNU MP is licensed under GNU Lesser General Public License.

: GNU Libtool (libltdl) |
libltdl is used to implement dynamic CALL statements.~
GNU Libtool is licensed under GNU Lesser General Public License.

NOTE - Libtool is not required for Linux and
Windows (including MinGW and Cygwin)

The following libraries are optional, but highly recommended:

: Berkeley DB (libdb) 1.85 or later |
libdb can be used to implement indexed file I/O and SORT/MERGE.~
Berkeley DB is licensed under the original BSD License (1.85) or their own open-source license (2.x or later). Note that, as of 2.x, if you linked your software with Berkeley DB, you must distribute the source code of your software along with your software, or you have to pay royalty to Oracle Corporation.
For more information about Oracle Berkeley DB dual licensing go to : Oracle / Embedded / Oracle Berkeley DB
Remark: support for BDB < 3.0 was dropped in OpenCOBOL 2.0

: Ncurses (libncurses) 5.2 or later |
libncurses can be used to implement SCREEN SECTION.~
Ncurses is licensed under a BSD-style license.

Be sure to install the development headers along with the libraries


See INSTALL for general installation instruction. Typically, this is done by the following commands:

$ ./configure
$ make
$ make install

NOTE: make install usually needs to be done under a root account

There are the following configure options:

--with-cc=<cc>    specify C compiler command used by cobc
--with-db1        use Berkeley DB 1.85 (libdb-1.85), not available with OpenCOBOL >= 2.0
--with-db         use Berkeley DB 3.0 or later (default)
--with-lfs64      use large file system for file I/O (default)


If you are a developer, consider building the latest OpenCOBOL from the SVN repository.

You need to install the following extra packages with specified minumum version before building OpenCOBOL:

  • Autoconf 2.59
  • Automake 1.9.6
  • Libtool 1.5.24
  • Gettext 0.14.1
  • m4 1.4.2
  • Texinfo 4.6
  • Bison 1.875
  • Flex 2.5.4

After checking out the latest source from the repository, run "autoreconf -i -I m4" to generate configure script. You need to run autoreconf whenever you modify or

Note to bash users; packages and the path cache

After a first time build with make, and having a previous package installed in /usr/bin, be careful to clear the internal path cache. If bash cached a

$ cobc -V
cobc (OpenCOBOL) 1.0.0
Copyright (C) 2001-2007 Keisuke Nishida
Copyright (C) 2007 Roger While

that it found in /usr/bin, the newer /usr/local/bin installation will not be searched in the path, until a new session or a

$ hash -r

internal command is used to reset the path cache. Then

$ cobc -V
cobc (OpenCOBOL) 1.1.0 Build date Jun  7 2008 12:37:33
Copyright (C) 2001-2008 Keisuke Nishida / Roger While

will pick up the proper local executables, and perhaps save a few minutes of confusion. This will only happen the very first time when and if cobc ends up in two places within the path search list and was used before a make install.

Note to Debian (and possibly Ubuntu) users: OpenCobol fails to see libncurses

ncurses is used by output to screen, e.g. DISPLAY statement.

To fix:


gedit /etc/

and add /usr/local/lib

to the file eg:

include /etc/*.conf /usr/local/lib

Create symbolic link to ncurses:

ln /lib/ /lib/

Re-run ld config:



Discussion: How to install OC 2.0 on Windows XP
Wiki: Home

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks