2014年6月10日 星期二

DJGPP DOS 版的 32-bit C/C++ compiler

"compiler及其環境在附件只能在windowsXP DOS command下建立"

安裝步驟
請至 djgpp web side 相對應的目錄下尋找本文中提到的檔案.
先在您的硬碟上(假設您欲安裝至 C 槽)建立一子目錄為 djgpp, 即 mkdir c:\djgpp, 並將之後所下載的檔案皆放置在該目錄下.


  1. 下載 unzip386.exe, 此檔為解 .zip 壓縮檔之工具程式.
  2. 下載:
    1. readme.1st
    2. djdev201.zip
    3. faq210b.zip
  3. 下載:
    1. txi390b.zip
    2. gcc2721b.zip
    3. bnu27b.zip
    4. mak37b.zip
    5. gpp2721b.zip
    6. lgp271b.zip
    7. gdb416b.zip
  4. 下載 csdpmi3b.zip
上述檔案皆下載完後, 用任何編輯軟體修改 autoexec.bat 檔, 加入下列二行: set PATH=C:\DJGPP\BIN;%PATH% set DJGPP=c:/djgpp/djgpp.env

重新啟動電腦並至 DOS mode 即可執行 C/C++ compiler.

如何邊譯程式
  1. 請用任何編輯軟體寫 C/C++ 程式, 如用 DOS 下的 edit.
  2. 將編輯好的程式存檔, 若您是寫 C 程式, 則存 xxx.c; 若寫 C++ 程式, 則存 xxx.cc
  3. 編譯 C 程式, 執行 gcc xxxx.c -o xxxx.exe; 編譯 C++ 程式, 執行 gxx xxx.cc -o xxx.exe各舉 C 和 c++ 簡單例子並編譯:
 /* hello.c */ 
 #include <stdio.h>
 int main()
 {
 printf("Hello, world.\n"); 
 } 
 因此編譯此程式(hello.c)的方式為 gcc hello.c -o hello.exe
 編譯完後執行 hello, 會看到 Hello, world. /

// hello.cc
 #include <iostream.h> 
 int main() {
 cout <<"Hello, world." << endl;
 }
 編譯此程式(hello.cc)之方式為 gxx hello.cc -o hello.exe 編譯完後執行 hello, 也會看到 Hello, world.字樣.

DJGPP 介紹
   DJGPP is a complete 32-bit C/C++ development system for Intel 80386 (and higher) PCs running DOS. It includes ports of many GNU development utilities. The development tools require a 80386 or newer computer to run, as do the programs they produce. In most cases, the programs it produces can be sold commercially without license or royalties.

Introduction
Why are you here? (common questions with answers)
Zip Picker (helps you decide what to download)
About DJGPP Version 2
DJGPP Project Overview
The history of DJGPP
Official DJGPP Year 2000 Statement
Current DJGPP status vs Windows 2000 and XP (unofficial)

Documentation
User's Guide (incomplete)
How-to Repository
C Library Reference
DPMI reference
Full List of Online Documentation
GNU Manuals

Getting Help
Frequently Asked Questions,
Search the Mail Archives
News Groups and Mailing Lists
Bug Tracking System

Getting DJGPP
DJGPP in CVS
Downloadable Files, Listings, and Extracts
Files Found on Other Sites
Other DJGPP Resources on the Internet
Public-Access Compiler Service

Other Stuff
16-bit tools
Alternate Malloc? 

沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。