- Plone 3.3 Site Administration
- Alex Clark
- 498字
- 2021-08-03 15:33:18
How to install a C compiler
Both Python and Zope 2 require a C compiler to build from source. So let us take a minute to explore the available options. Regardless of the packaging, each of the following software provides some version of the GNU Compiler Collection (GCC) and libraries (http://gcc.gnu.org/gcc-4.3/).
Installing a C compiler on Mac OS X
Before you can compile C code on Mac OS X, you must install XCode (http://developer.apple.com/technologies/tools/xcode.html).
Installing XCode
Check your Mac OS X installation DVD or Apple Developer Connection (http://developer.apple.com/) for the latest version.
Verify that GCC works
To verify that GCC works, open Finder | Applications | Utilities | Terminal and type:
$ gcc
You should see:

We have just finished explaining how to install and test a C compiler on Mac OS X.
Installing a C compiler on Windows
Before you can compile C code on Windows, you must install MinGW (or Microsoft's Visual Studio, but that approach is not covered in this book).
Downloading MinGW
To download MinGW with Internet Explorer:
- Browse to http://mingw.org.
- Click on View all files | Automated MinGW Installer | MinGW-5.1.6.exe. |
- Save the file.
- Run the installer.
Installing MinGW
Windows will present a series of dialogues you can answer based on the following suggestions:
- Select the current package
- Select g++ and check options in addition to the base tools
- Select the default location

Adding MinGW to the Environment Variable—Path
Now that a C compiler is installed, we would like to be able to easily run the gcc
command from the Command Prompt. To accomplish this, perform the following steps:
- Select Start | Computer System Properties | Advanced system settings | Environment Variables.
- Under System variables, scroll down to Path.
- Select Edit.
- Add the following separated by a semicolon:
C:\MinGW\bin
- Click on Save.
You should see:

Verify that GCC works
To verify that your C compiler works, select Start | All Programs | Accessories | Command Prompt and type:
$ gcc
You should see:

We have just demonstrated how to install and test a C compiler on Windows.
Configuring Distutils
Later, when you try to compile Zope 2, your Buildout may fail with a Visual Studio error like this:

To avoid this error, you can configure Distribute to use MinGW's C compiler. Just create a file called C:\Python\Lib\Distutils\distutils.cfg
, and include the following contents:
[build] compiler=mingw32
Visit http://plone.org/documentation/kb/using-buildout-on-windows/ for more information.
Installing a C compiler on Ubuntu Linux
Before you can compile C code on Ubuntu Linux, you must install the build-essential package (http://packages.ubuntu.com/lucid/build-essential):
$ sudo aptitude install build-essential
You should see:

Verify that GCC works
To verify that GCC works, type:
$ gcc gcc: no input files
You should see:

We have just demonstrated how to install and test a C compiler on Ubuntu Linux.
Installing additional development libraries
Later on, when you are using Buildout to install Python, you may encounter this error:

To avoid this error, install the zlib1g-dev
library:
$ sudo aptitude install zlib1g-dev
- 云化虛擬現實技術與應用
- 創意UI:Photoshop玩轉移動UI設計
- Photoshop圖形圖像設計案例教程(高等院校計算機任務驅動教改教材)
- SolidWorks 2008機械設計一冊通
- InDesign平面設計案例教程:從設計到印刷
- Photoshop CS6完全自學案例教程(微課版)
- Creo Parametric 5.0中文版從入門到精通
- Adobe創意大學InDesign CS5 版式設計師標準實訓教材
- 中文版Photoshop CS6全能一本通·全彩版
- Photoshop CS6從入門到精通
- SVG動畫
- Photoshop后期強:多重曝光專業技法寶典
- 玩轉掌上生活 手機網上生活達人秘笈
- Photoshop CS5數字圖像處理
- Excel 2016 VBA入門與應用