Building console application

How I can build a console application via HMG ?

We have a paradox here: though HMG is a GUI library, we are requesting a non-GUI service; since console means non-GUI.

But don’t wory, this is possible; even very easy, such as any HMG application, and with more than one method.

Method 1: Batch processing:

( Assuming HMG root folder is C:\hmg and name of your console application project file name is ConsOnly.HbP and your main prg file name is ConsOnly.Prg )

call c:\hmg\build.bat /c ConsOnly

( No matter ConsOnly is a project or program file. )

If your project has more than one .prg file, you may use build.bat such ways:

1- call c:\hmg\build.bat /c progr1 progr2 prog3 ...


2- First build a .hbp file contains such as:


and say name is “ConsOnly.Hbp” then invoke build.bat:

call c:\hmg\build.bat /c ConsOnly

The /c ( or /C ) switch inform build.bat about console.

You can omit this switch, by adding this line to top of your .prg file:


Method 2: Via HMG-IDE:

First you need add abowe


line to top of your .prg file.

And then, building a project file ( .hbp ). For example if your .prg file name is ConsOnly.prg, you may use a ConsOnly.HbP  file contains one line:


If your project has more than one .prg file, your project file contains a list of that .prg files. For example:


You may build this project file simply writing with a text editor or by selecting “New Project” within HMG-IDE.

And only thing is pressing “Run” button.

Yo don’t need any other thing.


Don’t include

#include <>

line into console-only .prg’s.

Technically no problem, you can add. Moreover with this  way, though project is console mode,   you can see error messages in GUI mode. But has a risk: may be some HMG functions have same names with Harbour and if you include “”, HMG functions will override others; an example may be  BROWSE(). If this is your intend,  no problem. But this situation sometime may be a nightmare.

One response to “Building console application

  1. Pingback: How I can build … | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.