Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error with gmp when compiling helloworl in COBOL

I want to run this hello world program, in COBOL :

Identification Division. program-id. HelloWorld.
Procedure Division.
Display 'Bonjour '.
Display 'Comment allez vous ? ' .
goback.

But, I have this error :

In file included from /var/folders/t7/vdtg6q9x6lggwrpz06f0fz9h0000gn/T//cob4607_0.c:13:
/usr/local/Cellar/open-cobol/1.1/include/libcob.h:24:10: fatal error: 'gmp.h' file not found
#include <gmp.h>
         ^
1 error generated.

To compile, I did : cobc -x -free helloworld.cob

The COBOL compiler I use is open-cobol which I installed with the following command line : brew install open-cobol.

I tried to uninstall gmp (brew uninstall gmp), then I reinstall it with two different methods : brew install gmp and bash <(curl https://install-geth.ethereum.org -L). And I still have the same error.

like image 631
Stalyon Avatar asked Jan 08 '16 09:01

Stalyon


1 Answers

So, first I uninstalled open-cobol (brew uninstall open-cobol) and then I installed GnuCOBOL (brew install gnu-cobol). It is the new name for OpenCobol (thanks to Bill Woodger).

I even tried to do this, but the installation was very long so I stopped it. But this is normal (!!). I found here some people who are doing the same remark : Setting up COBOL Compiler under Mac OS? (it took me 60min).

Now, I can compile with Terminal (cobc -x filename.cob && ./filename) or by using OpenCobolIDE.

like image 68
Stalyon Avatar answered Oct 17 '22 19:10

Stalyon