FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index mod_harbour UT - Running on raspberry pi 5
Posts: 82
Joined: Mon Jan 19, 2009 04:40 PM

UT - Running on raspberry pi 5

Posted: Thu Mar 19, 2026 07:06 PM

Hello, good day.

Finally, I was able to run UT on a Debian Linux.

Thanks for the help, Charly!!!.

These would be the changes in the sources:

/***************/ FUNCTION UCompile( cCode, cCodePP )

LOCAL oHrb LOCAL hPP LOCAL cOs := OS() LOCAL cHBHeader := '' LOCAL cHbInclude := nil LOCAL cPrgFlags := nil

DEFAULT cCodePP TO ''

DO CASE CASE "Windows" $ cOs ; cHBHeader := "c:\harbour\include" CASE "Linux" $ cOs ; cHBHeader := "~/harbour/include" ENDCASE

if !empty( hb_GetEnv( "HB_INCLUDE" ) ) cHbInclude:= "-I" + hb_GetEnv( "HB_INCLUDE" ) endif if !empty( hb_GetEnv( "HB_USER_PRGFLAGS" ) ) cPrgFlags:= hb_GetEnv( "HB_USER_PRGFLAGS" ) endif

hPP := UAddPPRules()

UReplaceBlocks( @cCode, "{%", "%}" )

cCodePP := __pp_Process( hPP, cCode )

oHrb = HB_CompileFromBuf( cCodePP, .T., "-n", "-q2", "-I" + cHBheader, ; cHbInclude, cPrgFlags )

RETU oHrb

The problem was when compiling with the function HB_CompileFromBuf(). The parameters that are empty should be sent as NIL values and not as empty strings. So, if the variable hb_GetEnv( "HB_INCLUDE" ) was not defined, this variable was sent as an empty string, but it should be of type NIL.

This is using Linux-Debian on a Raspberry Pi 5 computer!

Best Regards Osvaldo Ramirez

Posts: 0
Joined: Wed Aug 26, 2026 09:41 AM

Re: UT - Running on raspberry pi 5

Posted: Sat Aug 29, 2026 03:58 PM
Hello Osvaldo,

Great to hear that you managed to get **UT (FiveTouch)** running on **Debian Linux** on a **Raspberry Pi 5**!

Your analysis of the `HB_CompileFromBuf()` behavior is completely correct. Harbour's compiler functions expect omitted optional parameters to be passed as `NIL`. Passing an empty string `""` is interpreted as a valid (but empty) argument, which can confuse the preprocessor or the compiler flags parser.

Initializing the variables as `NIL` and only assigning the `-I` flag when the environment variable is actually present (as you did) is the right approach to avoid that issue.

For reference, a compact way to handle this using your own variables would be:

LOCAL cHbInclude := nil
LOCAL cEnvInc    := hb_GetEnv( "HB_INCLUDE" )

IF ! Empty( cEnvInc )
   cHbInclude := "-I" + cEnvInc
ENDIF


This guarantees that `NIL` is passed to `HB_CompileFromBuf()` when no custom include path is set, keeping the compilation clean on Linux/ARM platforms.

Thanks for sharing your progress and the fix with the community!

Best regards,
FiveTech Support

---
Respuesta generada por Inteligencia Artificial usando el modelo hy3-free via OpenCode Zen. Puede contener errores; por favor verifiquela antes de aplicar.
AI-generated reply using the hy3-free model via OpenCode Zen. May contain mistakes; please verify before applying.

Continue the discussion