Author Topic: Configure IDE for Harbour? (or I don't want to learn c/c++!!)  (Read 10708 times)

Offline xirconuk

  • Single posting newcomer
  • *
  • Posts: 9
Configure IDE for Harbour? (or I don't want to learn c/c++!!)
« on: October 14, 2005, 11:49:51 am »
Hi,

I was wondering if it was possible to configure C::B for the Xbase pre-compiler Harbour?  Harbour code is preprossed by harbour into C  and then compiled using borland bcc or mingw.  I currently use a batch file to do this (I will post later if it is any help).  I also use a set of gui libraries called minigui.

Steve

takeshimiya

  • Guest
Re: Configure IDE for Harbour? (or I don't want to learn c/c++!!)
« Reply #1 on: October 14, 2005, 12:15:59 pm »
I never heard before of Harbour, but I've heard before of Clipper :)

It would be possible, but you'll have to provide the sintax colouring and all.

The best way would be to make a Harbour-compiler plugin, but as you don't want to learn C++ (the best language of the world :D) you can make some 'hacks' like using the actual GCC-compiler plugin but calling instead a batch file or something.

Offline xirconuk

  • Single posting newcomer
  • *
  • Posts: 9
Re: Configure IDE for Harbour? (or I don't want to learn c/c++!!)
« Reply #2 on: October 14, 2005, 12:33:14 pm »
Hi Takeshimiya

Harbour is a 32bit open source clipper compatible xbase compiler - see www.harbour.org.  It is strong on data access (dbf) and produces code in C, which is then compiled by a C compiler such as Bcc or MinGW.  There is also xharbour (or extended harbour) which split off from the original project and is now mainly a commercial product.

The source files tend to have a .prg extension, so I currently write a program, shell to a command prompt and run a batch file with the source file name as a parameter.

Harbour was started when the owners of Clipper (Computer Assoc???) stopped developing it (clipper only exists in a 16 bit version afaik).

If it is not possible then it is not possible and I will continue with my trusty editor and command prompt!

Steve

takeshimiya

  • Guest
Re: Configure IDE for Harbour? (or I don't want to learn c/c++!!)
« Reply #3 on: October 14, 2005, 12:52:49 pm »
It IS possible, at the very least you can use the same functionality as your text editor+command prompt.

I'll take a look later.

Offline xirconuk

  • Single posting newcomer
  • *
  • Posts: 9
Re: Configure IDE for Harbour? (or I don't want to learn c/c++!!)
« Reply #4 on: October 14, 2005, 02:03:55 pm »
Thanks Takeshimiya,

I like the look and feel of the IDE.  Are there any instructions I could follow in the documentation to install harbour as a pre-processor?  The batch file I use is as follows:

@echo off
CLS

Rem Set Paths

IF "%MG_BCC%"=="" SET MG_BCC=c:\borland\bcc55
IF "%MG_ROOT%"=="" SET MG_ROOT=c:\minigui
IF "%MG_HRB%"=="" SET MG_HRB=c:\minigui\harbour

rem IF "%MG_HRB%"=="" SET MG_HRB=c:\xharbour

if exist %1.exe del %1.exe

Rem Debug Compile

if "%2"=="/d" GOTO DEBUG_COMP
if "%2"=="/D" GOTO DEBUG_COMP
if "%3"=="/d" GOTO DEBUG_COMP
if "%3"=="/D" GOTO DEBUG_COMP
if "%4"=="/d" GOTO DEBUG_COMP
if "%4"=="/D" GOTO DEBUG_COMP
if "%5"=="/d" GOTO DEBUG_COMP
if "%5"=="/D" GOTO DEBUG_COMP
if "%6"=="/d" GOTO DEBUG_COMP
if "%6"=="/D" GOTO DEBUG_COMP

%MG_HRB%\bin\harbour %1.prg -n -i%MG_HRB%\include;%MG_ROOT%\include; %2 %3

GOTO C_COMP

:DEBUG_COMP

ECHO OPTIONS NORUNATSTARTUP > INIT.CLD

%MG_HRB%\bin\harbour %1.prg -n -b -i%MG_HRB%\include;%MG_ROOT%\include; %2 %3

:C_COMP

%MG_BCC%\bin\bcc32 -c -O2 -tW -M -I%MG_HRB%\include;%MG_BCC%\include; -L%MG_BCC%\lib; %1.c

if exist %1.rc %MG_BCC%\bin\brc32 -r %1.rc

echo c0w32.obj + > b32.bc
echo %1.obj, + >> b32.bc
echo %1.exe, + >> b32.bc
echo %1.map, + >> b32.bc
echo %MG_ROOT%\lib\minigui.lib + >> b32.bc
echo %MG_HRB%\lib\dll.lib + >> b32.bc
echo %MG_HRB%\lib\rtl.lib + >> b32.bc
echo %MG_HRB%\lib\vm.lib + >> b32.bc
echo %MG_HRB%\lib\gtwin.lib + >> b32.bc
echo %MG_HRB%\lib\lang.lib + >> b32.bc
echo %MG_HRB%\lib\codepage.lib + >> b32.bc
echo %MG_HRB%\lib\macro.lib + >> b32.bc
echo %MG_HRB%\lib\rdd.lib + >> b32.bc
echo %MG_HRB%\lib\dbfntx.lib + >> b32.bc
echo %MG_HRB%\lib\dbfcdx.lib + >> b32.bc
echo %MG_HRB%\lib\dbfdbt.lib + >> b32.bc
echo %MG_HRB%\lib\dbffpt.lib + >> b32.bc
echo %MG_HRB%\lib\common.lib + >> b32.bc
echo %MG_HRB%\lib\debug.lib + >> b32.bc
echo %MG_HRB%\lib\pp.lib + >> b32.bc
echo %MG_HRB%\lib\libct.lib + >> b32.bc
echo %MG_HRB%\lib\libmisc.lib + >> b32.bc
echo %MG_HRB%\lib\hbsix.lib + >> b32.bc
echo %MG_HRB%\lib\hbole.lib + >> b32.bc
echo %MG_HRB%\lib\hbprinter.lib + >> b32.bc
echo %MG_HRB%\lib\socket.lib + >> b32.bc
echo %MG_HRB%\lib\miniprint.lib + >> b32.bc

Rem ODBC Libraries Link

if "%2"=="/O" echo %MG_HRB%\lib\hbodbc.lib + >> b32.bc
if "%2"=="/O" echo %MG_HRB%\lib\odbc32.lib + >> b32.bc
if "%2"=="/o" echo %MG_HRB%\lib\hbodbc.lib + >> b32.bc
if "%2"=="/o" echo %MG_HRB%\lib\odbc32.lib + >> b32.bc

if "%3"=="/O" echo %MG_HRB%\lib\hbodbc.lib + >> b32.bc
if "%3"=="/O" echo %MG_HRB%\lib\odbc32.lib + >> b32.bc
if "%3"=="/o" echo %MG_HRB%\lib\hbodbc.lib + >> b32.bc
if "%3"=="/o" echo %MG_HRB%\lib\odbc32.lib + >> b32.bc

if "%4"=="/O" echo %MG_HRB%\lib\hbodbc.lib + >> b32.bc
if "%4"=="/O" echo %MG_HRB%\lib\odbc32.lib + >> b32.bc
if "%4"=="/o" echo %MG_HRB%\lib\hbodbc.lib + >> b32.bc
if "%4"=="/o" echo %MG_HRB%\lib\odbc32.lib + >> b32.bc

if "%5"=="/O" echo %MG_HRB%\lib\hbodbc.lib + >> b32.bc
if "%5"=="/O" echo %MG_HRB%\lib\odbc32.lib + >> b32.bc
if "%5"=="/o" echo %MG_HRB%\lib\hbodbc.lib + >> b32.bc
if "%5"=="/o" echo %MG_HRB%\lib\odbc32.lib + >> b32.bc

if "%6"=="/O" echo %MG_HRB%\lib\hbodbc.lib + >> b32.bc
if "%6"=="/O" echo %MG_HRB%\lib\odbc32.lib + >> b32.bc
if "%6"=="/o" echo %MG_HRB%\lib\hbodbc.lib + >> b32.bc
if "%6"=="/o" echo %MG_HRB%\lib\odbc32.lib + >> b32.bc

Rem ZIP Libraries Linking

if "%2"=="/Z" echo %MG_HRB%\lib\zlib1.lib + >> b32.bc
if "%2"=="/Z" echo %MG_HRB%\lib\ziparchive.lib + >> b32.bc
if "%2"=="/z" echo %MG_HRB%\lib\zlib1.lib + >> b32.bc
if "%2"=="/z" echo %MG_HRB%\lib\ziparchive.lib + >> b32.bc

if "%3"=="/Z" echo %MG_HRB%\lib\zlib1.lib + >> b32.bc
if "%3"=="/Z" echo %MG_HRB%\lib\ziparchive.lib + >> b32.bc
if "%3"=="/z" echo %MG_HRB%\lib\zlib1.lib + >> b32.bc
if "%3"=="/z" echo %MG_HRB%\lib\ziparchive.lib + >> b32.bc

if "%4"=="/Z" echo %MG_HRB%\lib\zlib1.lib + >> b32.bc
if "%4"=="/Z" echo %MG_HRB%\lib\ziparchive.lib + >> b32.bc
if "%4"=="/z" echo %MG_HRB%\lib\zlib1.lib + >> b32.bc
if "%4"=="/z" echo %MG_HRB%\lib\ziparchive.lib + >> b32.bc

if "%5"=="/Z" echo %MG_HRB%\lib\zlib1.lib + >> b32.bc
if "%5"=="/Z" echo %MG_HRB%\lib\ziparchive.lib + >> b32.bc
if "%5"=="/z" echo %MG_HRB%\lib\zlib1.lib + >> b32.bc
if "%5"=="/z" echo %MG_HRB%\lib\ziparchive.lib + >> b32.bc

if "%6"=="/Z" echo %MG_HRB%\lib\zlib1.lib + >> b32.bc
if "%6"=="/Z" echo %MG_HRB%\lib\ziparchive.lib + >> b32.bc
if "%6"=="/z" echo %MG_HRB%\lib\zlib1.lib + >> b32.bc
if "%6"=="/z" echo %MG_HRB%\lib\ziparchive.lib + >> b32.bc

Rem ADS Libraries Linking

if "%2"=="/A" echo %MG_HRB%\lib\rddads.lib + >> b32.bc
if "%2"=="/A" echo %MG_HRB%\lib\ace32.lib + >> b32.bc
if "%2"=="/a" echo %MG_HRB%\lib\rddads.lib + >> b32.bc
if "%2"=="/a" echo %MG_HRB%\lib\ace32.lib + >> b32.bc

if "%3"=="/A" echo %MG_HRB%\lib\rddads.lib + >> b32.bc
if "%3"=="/A" echo %MG_HRB%\lib\ace32.lib + >> b32.bc
if "%3"=="/a" echo %MG_HRB%\lib\rddads.lib + >> b32.bc
if "%3"=="/a" echo %MG_HRB%\lib\ace32.lib + >> b32.bc

if "%4"=="/A" echo %MG_HRB%\lib\rddads.lib + >> b32.bc
if "%4"=="/A" echo %MG_HRB%\lib\ace32.lib + >> b32.bc
if "%4"=="/a" echo %MG_HRB%\lib\rddads.lib + >> b32.bc
if "%4"=="/a" echo %MG_HRB%\lib\ace32.lib + >> b32.bc

if "%5"=="/A" echo %MG_HRB%\lib\rddads.lib + >> b32.bc
if "%5"=="/A" echo %MG_HRB%\lib\ace32.lib + >> b32.bc
if "%5"=="/a" echo %MG_HRB%\lib\rddads.lib + >> b32.bc
if "%5"=="/a" echo %MG_HRB%\lib\ace32.lib + >> b32.bc

if "%6"=="/A" echo %MG_HRB%\lib\rddads.lib + >> b32.bc
if "%6"=="/A" echo %MG_HRB%\lib\ace32.lib + >> b32.bc
if "%6"=="/a" echo %MG_HRB%\lib\rddads.lib + >> b32.bc
if "%6"=="/a" echo %MG_HRB%\lib\ace32.lib + >> b32.bc

Rem MySql Libraries Linking

if "%2"=="/M" echo %MG_HRB%\lib\mysql.lib + >> b32.bc
if "%2"=="/M" echo %MG_HRB%\lib\libmysql.lib + >> b32.bc
if "%2"=="/m" echo %MG_HRB%\lib\mysql.lib + >> b32.bc
if "%2"=="/m" echo %MG_HRB%\lib\libmysql.lib + >> b32.bc

if "%3"=="/M" echo %MG_HRB%\lib\mysql.lib + >> b32.bc
if "%3"=="/M" echo %MG_HRB%\lib\libmysql.lib + >> b32.bc
if "%3"=="/m" echo %MG_HRB%\lib\mysql.lib + >> b32.bc
if "%3"=="/m" echo %MG_HRB%\lib\libmysql.lib + >> b32.bc

if "%4"=="/M" echo %MG_HRB%\lib\mysql.lib + >> b32.bc
if "%4"=="/M" echo %MG_HRB%\lib\libmysql.lib + >> b32.bc
if "%4"=="/m" echo %MG_HRB%\lib\mysql.lib + >> b32.bc
if "%4"=="/m" echo %MG_HRB%\lib\libmysql.lib + >> b32.bc

if "%5"=="/M" echo %MG_HRB%\lib\mysql.lib + >> b32.bc
if "%5"=="/M" echo %MG_HRB%\lib\libmysql.lib + >> b32.bc
if "%5"=="/m" echo %MG_HRB%\lib\mysql.lib + >> b32.bc
if "%5"=="/m" echo %MG_HRB%\lib\libmysql.lib + >> b32.bc

if "%6"=="/M" echo %MG_HRB%\lib\mysql.lib + >> b32.bc
if "%6"=="/M" echo %MG_HRB%\lib\libmysql.lib + >> b32.bc
if "%6"=="/m" echo %MG_HRB%\lib\mysql.lib + >> b32.bc
if "%6"=="/m" echo %MG_HRB%\lib\libmysql.lib + >> b32.bc

echo cw32.lib + >> b32.bc
echo import32.lib, >> b32.bc

if exist %1.res echo %1.res + >> b32.bc
if exist %MG_ROOT%\resources\hbprinter.res echo %MG_ROOT%\resources\hbprinter.res + >> b32.bc
if exist %MG_ROOT%\resources\miniprint.res echo %MG_ROOT%\resources\miniprint.res + >> b32.bc
echo %MG_ROOT%\resources\minigui.res >> b32.bc

Rem Debug Link

if "%2"=="/d" GOTO DEBUG_LINK
if "%2"=="/D" GOTO DEBUG_LINK
if "%3"=="/d" GOTO DEBUG_LINK
if "%3"=="/D" GOTO DEBUG_LINK
if "%4"=="/d" GOTO DEBUG_LINK
if "%4"=="/D" GOTO DEBUG_LINK
if "%5"=="/d" GOTO DEBUG_LINK
if "%5"=="/D" GOTO DEBUG_LINK
if "%6"=="/d" GOTO DEBUG_LINK
if "%6"=="/D" GOTO DEBUG_LINK

%MG_BCC%\bin\ilink32 -Gn -Tpe -aa -L%MG_BCC%\lib; @b32.bc

GOTO CLEANUP

:DEBUG_LINK

%MG_BCC%\bin\ilink32 -Gn -Tpe -ap -L%MG_BCC%\lib; @b32.bc

:CLEANUP

del *.tds
del %1.c
del %1.map
del %1.obj
del b32.bc
if exist %1.res del %1.res
%1

This is the bcc version. 

Steve




Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Configure IDE for Harbour? (or I don't want to learn c/c++!!)
« Reply #5 on: October 14, 2005, 05:33:09 pm »
WOW.  Just after I added the XBASE syntax highlighting. I noticed a flaw in the scintilla code, for xbase comments they have // instead of &&. I haven't submitted the patch to the Scintilla guys. Anyway I'm also interested in this, i might need it at the job :)

Offline xirconuk

  • Single posting newcomer
  • *
  • Posts: 9
Re: Configure IDE for Harbour? (or I don't want to learn c/c++!!)
« Reply #6 on: October 19, 2005, 04:42:15 pm »
Wayhey got my avatar working!!

So what do I have to do to configure C::B for use with harbour then? Are there any instructions anywhere so I can have a go myself or is it up to the development team???

Thanks

Steve

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Configure IDE for Harbour? (or I don't want to learn c/c++!!)
« Reply #7 on: October 19, 2005, 05:33:52 pm »
Um, you'd have to create a custom compiler, and configure the ADVANCED options in the compiler settings. But frankly, i think it'd be a lot of messing around, and because the harbour compiler doesn't compile into object but into C++ source code, i really don't know.

And the current compiler framework is limited, we're planning to revamp it after v1.0.

takeshimiya

  • Guest
Re: Configure IDE for Harbour? (or I don't want to learn c/c++!!)
« Reply #8 on: October 19, 2005, 08:01:40 pm »
Yeah, whatever we do now will be an ugly hack, better to wait for C::B-post 1.0

Just stick around the forums.

Offline xirconuk

  • Single posting newcomer
  • *
  • Posts: 9
Re: Configure IDE for Harbour? (or I don't want to learn c/c++!!)
« Reply #9 on: October 24, 2005, 03:04:50 pm »
Thanks Guys,

Will keep popping back from time to time, sorry about the delay in replying our voip phone system crashed thursday and it is only just working again.

Steve