hbmk2 issues without a C compiler installed

327 views
Skip to first unread message

Lorenzo Fiorini

unread,
Dec 10, 2014, 6:42:43 AM12/10/14
to harbou...@googlegroups.com
I don't know if it is a real issue but I wanted to test if harbour can
work without a C compiler so I copied only the harbour directory of a
"full" installation to a clean Windows 7 PC.

This simple test:

function main()
? "Hello World!"
return nil

compiled using:

hbmk2 -gh hello.prg

returns:

hbmk2: Could not detect any supported C compiler in your PATH.
Setup one or set -comp= option to one of these values: mingw, msvc,
clang, bcc, watcom, icc, pocc, xcc, tcc, mingw64, msvc64, msvcia64,
bcc64, iccia64, pocc64

( note that harbour -gh hello.prg works as expected ).

If I add a fake -comp=msvc ( or whatever else I don't have a C
compiler installed ) it compiles and run if I type:

hbmk2 hello.hrb

but if I type:

hbmk2 -gtcgi hello.hrb

I get the same message about the missing C compiler

if I add -comp=msvc it gives:

C:\opt\harbour\bin>hbmk2 -gtcgi hello.hrb -comp=msvc

Hello World!
Hello World!
Hello World!
Hello World!hbmk2: Error: Running C/C++ compiler. -1
cl.exe -nologo -c -O2 -W4 -wd4127 -FoC:\Users\User\AppData\Local\Temp\hbmk_
sjifq6.dir\ -IC:\opt\harbour\include C:\Users\User\AppData\Local\Temp\hbmk_v
29uni.c

Hello World!
Hello World!
Hello World!
C:\opt\harbour\bin>

best rgards,
Lorenzo

Juan L. Gamero

unread,
Dec 11, 2014, 5:43:44 AM12/11/14
to harbou...@googlegroups.com
Lorenzo:

Could -hbraw or -hbcmp hbmk2 switches be of any help here?

Regards,
--
Juan L. Gamero

José Quintas

unread,
Dec 11, 2014, 7:06:41 AM12/11/14
to harbou...@googlegroups.com
Hi

Em 10/12/2014 09:42, Lorenzo Fiorini escreveu:
> hbmk2: Error: Running C/C++ compiler. -1

When you define -comp=msvc you eliminate the auto-detect from hbmk2.
hbmk2 do not check if msvc exists, only execute compile commands.

When execute cl.exe, (msvc compiler), error -1 because it does not exists.

If you have a compiled EXE of the project, it remains untouched.

José M. C. Quintas

Lorenzo Fiorini

unread,
Dec 11, 2014, 10:53:57 AM12/11/14
to harbou...@googlegroups.com
On Thu, Dec 11, 2014 at 1:06 PM, José Quintas <josed...@mandic.com.br> wrote:

> When you define -comp=msvc you eliminate the auto-detect from hbmk2.
> hbmk2 do not check if msvc exists, only execute compile commands.

Yes, that is what I wanted to show.
IMHO hbmk2 should check for a C compiler only when needed.
Compiling and running prgs/hrbs should not require any external tool.

best regards,
Lorenzo

Lorenzo Fiorini

unread,
Dec 11, 2014, 11:53:51 AM12/11/14
to harbou...@googlegroups.com
On Thu, Dec 11, 2014 at 11:43 AM, Juan L. Gamero <jlga...@gmail.com> wrote:

> Could -hbraw or -hbcmp hbmk2 switches be of any help here?

hbmk2 -hbcmp hello.prg
or
hbmk2 -hbcmp -gh hello.prg

give: Could not detect any supported C compiler...

hbmk2 -hbraw hello.prg

creates hello.c

Of course for a skilled Harbour developer these are not real problems,
but for a newcomer the difference between harbour binary and hbmk2 and
the requirement of a C compiler can be misleading.

best regards,
Lorenzo

José Quintas

unread,
Dec 11, 2014, 2:41:14 PM12/11/14
to harbou...@googlegroups.com
Harbour create a C source from a PRG source.
You allways need a C compiler.

hbmk2 is a utility that makes easy the compile/link operation.

This is not required to run result.

Any additional information, please post in harbour-users.

José M. C. Quintas

Lorenzo Fiorini

unread,
Dec 11, 2014, 3:38:54 PM12/11/14
to harbou...@googlegroups.com
On Thu, Dec 11, 2014 at 8:41 PM, José Quintas <josed...@mandic.com.br> wrote:

> Harbour create a C source from a PRG source.
> You allways need a C compiler.

Wrong: harbour has always created .hrb files ( see harbour --help )
and doesn't require a C compiler. This is an hbmk2 issue.

> hbmk2 is a utility that makes easy the compile/link operation.
> This is not required to run result.

Wrong: hbmk2 has substituted hbrun and is the only tool that run hrbs
( see many examples in the tree: every *.hb is run by hbmk2 )

> Any additional information, please post in harbour-users.

????

best regards,
Lorenzo
Reply all
Reply to author
Forward
0 new messages