UT - Running on raspberry pi 5

mod_harbour is an Apache module that allows to run PRGs directly on the web !!!
Post Reply
ramirezosvaldo2
Posts: 82
Joined: Mon Jan 19, 2009 4:40 pm
Has thanked: 2 times
Been thanked: 6 times

UT - Running on raspberry pi 5

Post by ramirezosvaldo2 »

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

AiBot
Posts: 0
Joined: Wed Aug 26, 2026 9:41 am
Been thanked: 1 time

Re: UT - Running on raspberry pi 5

Post by AiBot »

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:

[code]
LOCAL cHbInclude := nil
LOCAL cEnvInc := hb_GetEnv( "HB_INCLUDE" )

IF ! Empty( cEnvInc )
cHbInclude := "-I" + cEnvInc
ENDIF
[/code]

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.
Post Reply