========================
MinGW开发工具的安装
========================
MinGW是Minimalist GNU for Windows的缩写,是把Linux下的GNU开发工具包移植到Windows的项目之一。
和Cygwin不一样的是,MinGW不提供Linux的POSIX运行系统的模拟层,而是直接使用Windows的运行库,因而开发的Windows的程序可以说是原生的,这样就方便了项目的移植, 程序的运行效率也要比Cygwin高,而Cygwin本身很多的DLL也是使用MinGW来编译的。
MinGW包含几个包:
* MinGW —— GCC的编译套件
* MSYS —— UNIX命令行工具
* MSYS DTK —— MSYS的开发工具包
* MinGW PORT —— 用于移植GNU项目到MinGW的工具包
在MinGW编译套件中又包含:
* mingw-runtime —— 运行支持的头文件和库文件
* w32api —— windows API的头文件和库文件
* gcc-core —— C编译器
* gcc-g++ —— C++的编译器
* gcc-objc —— objective c的编译器
* gcc-gfortran ——fortran 90/95的编译器
* gcc-java —— java的编译器
* gcc-ada —— ada的编译器
* mingw-gdb —— GNU 调试器的windows原生编译版本
* mingw32-make ——GNU make的原生编译版本
* mingw-utils —— 其他的一些杂项工具
安装MinGw非常的简单,从http://www.mingw.org下载最新的安装包比如我下载的版本mingw-get-inst-20120426.exe,运行后按提示一步步安装就
可以了,注意的是要选择上MSYS系统,这样才能使用MinGW shell:
安装过程中会自动从网络下载一些包文件,安装完成后在开始菜单中打开MinGW Shell就到了MinGw的编译环境了,这里可以使用Linux下我们熟悉的
ls,cd,make等命令了,vim也是内嵌支持的,所以和在Linux下没有多大的区别,非常的方便。使用mount命令我们可以看到Windows盘符在系统中的
对应位置,比如e:/会被mount到/e下。
在MinGW的主页上也有说到,MinGw是时下除了微软自己外仅有的高质量的免费编译工具了,其他的一些免费工具都有各自的局限性比如LCC-Win32只支持C、Djgpp只支持DOS32,Cygwin在GUI程序中需要使用X Server等等,MinGW便成了开源项目中的最好选择了。
在http://visual-mingw.sourceforge.net/还可以找到一个MinGW的IDE开发界面,如果对命令行不习惯的话可以使用它。
对于MinGW的配置,可以先进入MinGW Shell,
使用"mingw-get --help"命令看下安装工具的说明,然后 使用 "mingw-get install msys-groff"
"mingw-get install msys-man"命令来安装man包,然后去 http://www.kernel.org/pub/linux/docs/man-pages/ 下载man手册,当前的最新版本是man-pages-3.43.tar.gz,放置到C:\MinGW\msys\1.0\home\user目录下,其中"C:\MinGW"是我自己选择的MinGW安装目录,"user"是当前登录Windows的用户名。
使用命令"tar -xzvf man-pages-3.43.tar.gz"解压缩该文件,你会在当前目录中发现多了一个文件夹"man-pages-3.43",进入该文件夹"cd ./man-pages-3.43",运行命令"make",直至安装结束。可以用"man printf"测试一下,man手册是否安装成功,具体可以进入"..\share\man"目录查看。
现在为GCC和G++配置环境变量:
MINGW_PATH=C:\MinGW
C_INCLUDE_PATH=%MINGW_PATH%\include;%MINGW_PATH%\lib\gcc\mingw32\4.6.2\include
CPLUS_INCLUDE_PATH=%MINGW_PATH%\lib\gcc\mingw32\4.6.2\include\c++;%C_INCLUDE_PATH%
LIBRARY_PATH=%MINGW_PATH%\lib;%MINGW_PATH%\lib\gcc\mingw32\4.6.2
PATH=%MINGW_PATH%\bin;%MINGW_PATH%\libexec\gcc\mingw32\4.6.2
在 我的电脑->属性->高级->环境变量 中
include 增加D:\MinGW\include
lib 增加D:\MinGW\lib
PATH 增加D:\MinGW\bin;D:\MinGW\msys\1.0\bin
Path 增加D:\Vim\vim73 /*在MinGW Shell中可以用命令"gvim"打开gVim*/
============================================
Installing a MinGW OpenCOBOL Compiler
=========================================
http://www.opencobol.org/modules/bwiki/index.php?UserManual
http://www.opencobol.org/modules/bwiki/index.php?InstallGuide
OpenCOBOL is an open-source COBOL compiler, which translates COBOL programs to C code and compiles it using the native C compiler.
-------------------------------------------------------------------------------------------------------
please follow the steps below to install Open-Cobol
==================================
1) Install GMP:
==================================
GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers.
A. mingw-get install mingw32-gmp
==================================
2) Installing Berkeley DB for MinGW
==================================
http://sourceforge.net/apps/mediawiki/cobcurses/index.php?title=Install-MinGW-BDB
At the time of this documentation, the Open-Cobol package only supports up to version 4.5.
1.Download Berkeley 4.5.20-NC.tar.gz(withoutencryption)from http://www.oracle.com/technology/products/berkeley-db/db/index.html
$ tar tzvf db-4.5.20.NC.tar.gz | head -5
drwxrwxr-x 100/100 0 2006-09-20 16:30:09 db-4.5.20.NC
-r--r--r-- 100/100 5676 2006-09-07 17:31:55 db-4.5.20.NC/LICENSE
-r--r--r-- 100/100 224 2006-09-20 16:07:12 db-4.5.20.NC/README
drwxrwxr-x 100/100 0 2006-09-20 16:22:21 db-4.5.20.NC/btree
-r--r--r-- 100/100 61841 2006-08-24 10:56:10 db-4.5.20.NC/btree/bt_compact.
2. Unpack it and change to its build_unix subdirectory (ignore the warnings about symlinks).
A. $ tar zxf db-4.5.20.NC.tar.gz
B. $ cd db-4.5.20.NC/build_unix/
C. $ ../dist/configure --enable-mingw --prefix=/mingw --enable-compat185 LIBCSO_LIBS=-lwsock32
D. make.
E. make install
6. Inspect your /mingw/bin directory. You should be able to find your BDB DLL file there: libdb-4.5.dll
==================================
3) Install ncurses
==================================
download ncuses library (v5.9) from http://ftp.gnu.org/pub/gnu/ncurses/
A.tar xvv ncurses-5.9.tar.gz
B.cd ncurses-5.9
C.configure --enable-term-driver --enable-sp-funcs --prefix=/mingw
D.make
E.make install
==================================
4) Install Open-Cobol
==================================
http://www.opencobol.org/modules/bwiki/index.php?UserManual
http://www.opencobol.org/modules/bwiki/index.php?InstallGuide
http://sourceforge.net/apps/mediawiki/cobcurses/index.php?title=Install-MinGW-Open-Cobol
A.tar xvf open-cobol-1.1.tar.gz
B.cd open-cobol-1.1
C.configure --prefix=/mingw
D.make
E.make install
在编译和运行hello.cob是,需要:
export COB_CONFIG_DIR=/mingw/share/open-cobol/config
富士通COBOL 编译器Windows版本
0Fujitsu NetCOBOL Enterprise For Windows v9.0
本文档为【OpenCobol环境搭建】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑,
图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。