Include files while compiling not found

155 views
Skip to first unread message

Mario Emmanuel

unread,
Sep 29, 2023, 1:21:27 PM9/29/23
to Harbour Users
Hi,

I am trying to compile this basic example from a clipper book.
The issue is not related to this example, but general when I try to include a .ch file.

I am using FreeBSD and I have checked that the include files at the -I parameter actually contain the inkey.ch file.

---
$ cat Test1.prg
#include "inkey.ch"

LOCAL cString := "Hello World"
LOCAL nKey

SET COLOR TO "W/B,N/BG,BG,,N+/BG"
@ 10, 12 SAY cString
nKey := Inkey(0)
IF nKey == K_ESC
        ? Space(12) + "Good bye cruel world."
ENDIF

---
$ cat makefile
CC = cc
HB = /usr/local/bin/harbour
HB_INCLUDE = -I/usr/local/include/harbour
HB_LIB = -L/usr/local/lib/harbour -lhbvm -lhbdebug -lhbcommon -lhbrtl -lhbnulrdd  -lhbmacro -lhbvmmt -lgttrm -lm

all: Test1

Test1: Test1.c
        $(CC) $(HB_INCLUDE) -c Test1.c
        $(CC) Test1.o $(HB_LIB) -o Test1

Test1.c: Test1.prg
        $(HB) Test1.prg

clean:
        rm -f *.o *.c CustomerAddScreenTest

---
$ make Test1
/usr/local/bin/harbour Test1.prg
Harbour 3.4.0dev () (20-2-08-86 66:16)
Copyright (c) 1999-2022, https://github.com/vszakats/hb/
Compiling 'Test1.prg'...
Test1.prg(1) Error F0029  Can't open #include file 'inkey.ch'
*** Error code 1

Stop.

--
$ ls /usr/local/include/harbour/
achoice.ch      fileio.ch       hbapiitm.h      hbdate.h        hbgtreg.h       hbmather.h      hbscalar.hbx    hbtrace.ch      hbzlib.h
assert.ch       filesys.api     hbapilng.h      hbdbf.h         hbhash.ch       hbmemory.ch     hbserial.ch     hbtrace.h       hbznet.h
blob.ch         fm.api          hbapirdd.h      hbdbferr.h      hbhash.h        hbmemvar.ch     hbset.h         hbtypes.h       inkey.ch
box.ch          getexit.ch      hbapistr.h      hbdebug.ch      hbhrb.ch        hbmsgreg.h      hbsetup.ch      hbundoc.api     item.api
button.ch       gt.api          hbarc4.h        hbdefs.h        hbiniseg.h      hboo.ch         hbsetup.h       hbusrrdd.ch     memoedit.ch
clipdefs.h      harbour.hbx     hbassert.h      hbdyn.ch        hbinit.h        hbpcode.h       hbsix.ch        hbusrrdd.hbx    ord.ch
color.ch        hb.ch           hbatomic.h      hberrors.h      hbinkey.ch      hbpers.ch       hbsocket.ch     hbver.ch        rdd.api
common.ch       hb_io.h         hbbfish.h       hbexprop.h      hbiousr.ch      hbpp.h          hbsocket.h      hbver.h         rddsys.ch
dbedit.ch       hbapi.h         hbcdpreg.h      hbextcdp.ch     hbjson.h        hbrddcdx.h      hbstack.h       hbvm.h          reserved.ch
dbinfo.ch       hbapicdp.h      hbchksum.h      hbextern.ch     hblang.ch       hbrdddbf.h      hbstdgen.ch     hbvmint.h       set.ch
dbstruct.ch     hbapicls.h      hbclass.ch      hbextlng.ch     hblang.hbx      hbrdddel.h      hbstrict.ch     hbvmopt.h       setcurs.ch
directry.ch     hbapicom.h      hbcom.ch        hbfloat.h       hblpp.ch        hbrddfpt.h      hbsxdef.ch      hbvmpub.h       simpleio.ch
error.api       hbapidbg.h      hbcomp.h        hbgfx.ch        hbmacro.ch      hbrddnsx.h      hbsxfunc.h      hbwince.h       std.ch
error.ch        hbapierr.h      hbcompdf.h      hbgfxdef.ch     hbmacro.h       hbrddntx.h      hbtask.h        hbwinuni.h      tbrowse.ch
extend.api      hbapifs.h       hbcpage.hbx     hbgtcore.h      hbmath.ch       hbrddsdf.h      hbthread.ch     hbxvm.h         vm.api
extend.h        hbapigt.h       hbcrypto.h      hbgtinfo.ch     hbmath.h        hbregex.h       hbthread.h      hbzlib.ch

Itamar M. Lins Jr. Lins

unread,
Sep 30, 2023, 6:15:46 PM9/30/23
to harbou...@googlegroups.com
Hi!
use hbmk2 Test1.prg

Best regards,
Itamar M. Lins Jr.

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/13449b42-682e-4ce2-b6ef-640ef360aa55n%40googlegroups.com.

Damian (DriftZone.pl)

unread,
Sep 30, 2023, 7:04:50 PM9/30/23
to Harbour Users
Hi!
correctly it should be this:

C = cc
HB = /usr/local/bin/harbour
HB_INCLUDE = -I/usr/local/include/harbour
HB_LIB = -L/usr/local/lib/harbour -lhbvm -lhbdebug -lhbcommon -lhbrtl -lhbnulrdd  -lhbmacro -lhbvmmt -lgttrm -lm

all: Test1

Test1: Test1.c
        $(CC) $(HB_INCLUDE) -c Test1.c
        $(CC) Test1.o $(HB_LIB) -o Test1

Test1.c: Test1.prg
        $(HB) Test1.prg $(HB_INCLUDE)


clean:
        rm -f *.o *.c CustomerAddScreenTest

Mario Emmanuel

unread,
Oct 1, 2023, 9:32:55 AM10/1/23
to Harbour Users
Thanks, I was as you pointed out missing the $(HB_INCLUDE) in the Harbour compile
Reply all
Reply to author
Forward
0 new messages