关于 MinGW 安装问题

自己想在windows 编译 SMPlayer

所以要搭建 编译环境,采用了GCC

在Windows就用 MinGW

看到网上有很多关于安装MinGW的文章,觉得不太明白为什么要这么安装

后来自己看了一下www.MinGW.org 安装文档,觉得一幕了然。

Manual Installation

Instead of using an installer you can as well get all required packets and unpack them manually into a subdirectory. In fact that's what this writer is doing himself.

Download the Packages

At least the following (or newer) packages from the

are needed (the automated mingw installer I think includes all of these and sets up the right directory for you--what it's doing is downloading compilers and default header files, and putting them in one place on your system, so the future builds will use those compilers and directories for building):

Note that you will need gcc-core for other gcc language front ends to work properly.

These files are gzipped tarballs, Linux users will probably be familiar with .tar.gz files, but they are not that common under Windows. Essentially they are compressed folders like zip files. In order to access the contents you will need to decompress them, this requires that you have gzip and tar installed on your machine. Linux comes with these as standard in every distribution, but under Windows you will need to install them manually. Windows versions can be found at:

and

or

If you see a file with the extension lzma or xz instead of tar, it uses a newer compression algorithm that makes use of lzma. It's become the standard for Slackware tarballs and many Linux distributions are starting to use xz because it offers better compression ratios than tar. To decompress a file with the lzma or the xz extension, you can use 7zip http://www.7-zip.org/ . If you prefer the command line, there's a 7za program at the 7zip site. You can also check the mingw file archives for the xz program. It will decompess xz files or the files using the older lzma standard.

Download the setup files and install the applications. Before you use them you need to tell Windows where to find them; specifically this means adding the install directory to your PATH . To do this, follow the procedure below, to update the PATH appropriately, in your Environment Settings .

Create Install Directory

Caution : Never install MinGW into any directory which includes spaces in its absolute path name .

Create a directory to install all the stuff into. This writer usually creates C:/MinGW , (the recommended default), and copies all of the above files in there. Now issue the following commands, remember to change the file names to match your downloads:

cd /d c:/MinGW
gzip -df binutils-2.19.1-mingw32-bin.tar.gz
tar -xf binutils-2.19.1-mingw32-bin.tar
cd info
ren dir dir.binutils
cd ..
gzip -df gcc-core-3.4.5-20060117-3.tar.gz
tar -xf gcc-core-3.4.5-20060117-3.tar
cd info
copy dir dir.gcc
copy dir+dir.binutils
cd ..
gzip -df gcc-g++-3.4.5-20060117-3.tar.gz
tar -xf gcc-g++-3.4.5-20060117-3.tar
gzip -df mingwrt-3.15.2-mingw32-dev.tar.gz
tar -xf mingwrt-3.15.2-mingw32-dev.tar
gzip -df mingwrt-3.15.2-mingw32-dll.tar.gz
tar -xf mingwrt-3.15.2-mingw32-dll.tar
gzip -df w32api-3.13-mingw32-dev.tar.gz
tar -xf w32api-3.3-mingw32-dev.tar
Notes:
  1. If you wish to use other programming languages, in addition or instead of "C" and "C++", you should repeat the commands related to "gcc-g++", substituting the appropriate language package tarball; you must still install the "gcc-core" package .
  2. The indicated commands copying and concatenating the info /dir files are really a rather crude way of creating a combined documentation catalogue; they apply only if using older package versions than those indicated, since precompiled info /dir files are no longer distributed. In any case, this technique really isn't appropriate: see the comment below , for discussion on the purpose of, and the correct way to maintain, an info catalogue .
Additional Programming Languages

To add additional languages apply some or all of the following commands:

cd /d c:/MinGW
tar xvzf gcc-ada-3.4.5-20060117-1.tar.gz
tar xvzf gcc-g77-3.4.5-20060117-1.tar.gz
tar xvzf gcc-java-3.4.5-20060117-1.tar.gz
tar xvzf gcc-objc-3.4.5-20060117-1.tar.gz
MSYS Installation

You may also want to install MSYS .

Environment Settings

When you install command line tools, such as MinGW , or GnuWin32 tools, you have to tell the command line interpreter where to find them; this is usually accomplished by adding the appropriate directory names to the PATH variable in your environment. Typically, it is your responsibility to do this; please do not expect the installer, (if you used one), to do it for you.

Warning : Adding entries to the PATH is normally benign. However, if you delete, you may mess up your PATH string, and you could seriously compromise the functioning of your computer. Please be careful .

  1. Right-click on "My Computer" and select "Properties".
  2. Click Advanced -> Environment Variables.
  3. In the box entitled "System Variables" scroll down to the line that says "PATH " and double-click the entry.
  4. You will be presented with a dialog box with two text boxes, the bottom text box allows you to edit the PATH variable. It is very important that you do not delete the existing values in the PATH string, this will cause all sorts of problems for you!
  5. Scroll to the end of the string and at the end add ";<installation-directory>/bin". Here <installation-directory> is the full absolute path name of the installation directory; if you accepted the defaults when installing tar and gzip, then for these, it will (probably) be C:/Program Files/GnuWin32 , while for MinGW it will be C:/MinGW/bin , (if you kept to the recommended default installation directory). Don't forget the semicolon; this separates the entries in the PATH .
  6. press OK -> OK -> OK and you are done.

我想大概说下一里面的意思,具体就希望大家能够去认真读一下。

手工安装方法:

MinGW 有很多包组成的

最基础是 BaseSystem。

BaseSystem又包过 GNU-Binutils GCC GDB RuntimeLibrary

下载相应文件,并把他们解压到D:/MinGW中,就可以。(D:/MinGW是为 MinGW安装目录)

环境设置: 将D:/MinGW/bin添加到Path当中去就可以。

 

得到一点感受就是,要想得到第一手信息,还是读英文文档。

 

 

 

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值