Tags
sumbangan artikel oleh Teddy
Bila anda pernah membuat program dengan menggunakan bahasa xBase, tentunya anda tidak asing lagi dengan compiler Clipper. [x]Harbour (http://www.xharbour.org) merupakan alternatif compiler selain Clipper. [x]Harbour hampir 100% telah mendukung Clipper, juga free.
Anda yang pernah membuat aplikasi dengan compiler Clipper, bisa langsung meng-compile dengan mengunakan [x]Harbour, dengan catatan program yang telah anda buat tidak menggunakan 3rd party library, kecuali hanya sebagian kecil 3rd library yang telah didukung, diantaranya Nantucket-Tools atau Clipper-Tools (CT/CTUS).
Silahkan lihat untuk contrib-page di:
http://cvs.sourceforge.net/viewcvs.py/xharbour/xharbour/contrib
Setelah anda sedikit berkenalan dengan [x]Harbour anda harus men-download program bantu untuk membuat file yang telah di-compile dengan menggunakan [x]Harbour bisa dibuat menjadi bentuk Exe atau Lib.
Silahkan Download free BCC compiler di:
ftp://ftpd.borland.com/download/bcppbuilder/freecommandLinetools.exe
Install freecommandLinetools.exe pada lokasi default (C:\BORLAND\BCC55\)
Edit file Autoexec.bat tambakan/sisipkan pada PATH yaitu:
c:\borland\bcc55\bin\
atau jika anda menggunakan W2K di Environment Variables pada PATH yaitu:
c:\borland\bcc55\bin\
Setelah itu, ambil juga file [x]Harbour di:
http://www.xharbour.org/index.asp?page=download/windows/binaries_win
ambil file(s):
xHarbour Binaries for Borland C++ 5.5.1
xHarbour Contributions Libraries for Borland C++ 5.5.1
Program Pertama-ku
coba anda buat/copy file program (test.prg) seperti di bawah ini:
*-----test.prg
clear
? 'Hallo Indonesia'
inkey(0)
*-----end of test.prg
kemudian buat/copy file batch (xhb.bat) di bawah ini:
*---xhb.bat
@echo off
CLS
del *.obj
del *.c
del *.bak
c:\xharbour\bin\harbour.exe test.prg -ic:\xharbour\include
echo -Ic:\xharbour\include;c:\borland\bcc55\include;
-Lc:\borland\bcc55\lib > bld.tmp
echo -etest.exe >> bld.tmp
echo test.c >> bld.tmp
echo c:\xharbour\lib\rtl.lib >> bld.tmp
echo c:\xharbour\lib\vm.lib >> bld.tmp
echo c:\xharbour\lib\gtwin.lib >> bld.tmp
echo c:\xharbour\lib\lang.lib >> bld.tmp
echo c:\xharbour\lib\codepage.lib >> bld.tmp
echo c:\xharbour\lib\macro.lib >> bld.tmp
echo c:\xharbour\lib\rdd.lib >> bld.tmp
echo c:\xharbour\lib\dbfntx.lib >> bld.tmp
echo c:\xharbour\lib\dbfcdx.lib >> bld.tmp
echo c:\xharbour\lib\dbfdbt.lib >> bld.tmp
echo c:\xharbour\lib\dbffpt.lib >> bld.tmp
echo c:\xharbour\lib\common.lib >> bld.tmp
echo c:\xharbour\lib\debug.lib >> bld.tmp
echo c:\xharbour\lib\pp.lib >> bld.tmp
echo c:\xharbour\lib\hbct.lib >> bld.tmp
echo c:\xharbour\lib\libmisc.lib >> bld.tmp
echo cw32.lib >> bld.tmp
echo import32.lib >> bld.tmp
IF EXIST test.res echo test.res >> bld.tmp
rem ilink32 -Gn -Tpe -aa @bld.tmp
c:\borland\bcc55\bin\bcc32 @bld.tmp
if exist bld.tmp del bld.tmp
if exist test.c del test.c
if exist test.obj del test.obj
if exist test.bak del test.bak
if exist test.tds del test.tds
if exist test.exe dir test.exe
if exist test.exe echo.
if exist test.exe echo %1.exe succesfully built
if exist test.exe echo.
goto end
:noexist
echo.
echo Cannot find test.prg file
echo.
goto end
:end
*—end of xhb.bat
file-file di atas berbentuk text file.
Kemudian kedua file di atas di letakkan pada satu directory/folder misalnya xharbour, jalankan batch file dengan:
D:\xharbour>xhb
Apabila tidak ada kesalahan akan terlihat file baru yaitu test.exe.
Ok, silahkan mencoba! satu hal yang menggembirakan ternyata [x]Harbour bisa dijalankan di banyak platform diantaranya Dos, Windows dan Linux. Sehingga anda bisa menghemat waktu anda jika bermaksud bermigrasi dari Dos/Windows ke Linux.
Untuk selanjutnya silahkan bergabung di:
http://groups.yahoo.com/group/xharbour-id
Salam Hormat
Tedd