LoginSignup
4
4

More than 5 years have passed since last update.

Mac(OS:El Capitan)でのCOBOL開発環境構築

Posted at

ドットインストールで勉強しようと試みたところ、
いきなりvagrantとcobolを導入した状態から始まるので開発環境を整える必要があった。

開発環境構築に手間取ったのでメモを残す。

————————————————————
環境の構築
————————————————————

●目的:home-brewにopencobolを導入する

1.home-brewを導入方法(El Capitanとの相性が悪いので詳細が記載されている)
http://blog.h-wd.info/2015/10/08/mac-os-x-10-11-el-capitan%E3%81%ABhomebrew%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/

▼上記で自分がどれに当てはまるのか調べるためusr/localの場所を調査
http://d.hatena.ne.jp/testnoda/20120515/1337069061

2.brewでopen cobolを導入
最新GNU COBOLはbrewでは導入出来ないようだった(20160115現在)
http://blog.morizotter.com/2014/05/03/my-first-cobol/

3.アプリケーションも導入出来るようにするためにHomebrew Caskも導入

▼vagrantやvirtualBOXをインストール
http://qiita.com/moomoo-ya/items/30f9ffdb7dd34caf9ec0

4.cobolファイルのコンパイル

4−1.コンパイルを試みるが
/usr/local/Cellar/open-cobol/1.1/include/libcob.h:24:10: fatal error: 'gmp.h'
file not found
とエラーがでるので下記から
brew install gmp
brew install gettext
を追加
http://d.hatena.ne.jp/houmei/20111010/1318232081

▼シンボリックリンクを作成
libcob.hファイル内にgmp.hをincludeする記述があるのでincludeディレクトリ内にgmp.hのシンボリックリンクを設置
●コマンド
ln -s /usr/local/Cellar/gmp/6.0.0a/include/gmp.h /usr/local/Cellar/open-cobol/1.1/include

▼シンボリックリンクの作り方
http://qiita.com/pugiemonn/items/e5fb508df690a323ee14

4-2 さらに下記のエラーが
ld: library not found for -lgmp
clang: error: linker command failed with exit code 1 (use -v to see invocation)

▼コマンドラインツールを入れることで解消
http://qiita.com/takecian/items/bd9fd49c9b9704d6c425

5.無事コンパイル

▼home-brew導入から使い方まで記載
http://vdeep.net/intr-homebrew

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4