I have a question about the function HB_CompileFromBuf().
When I use the following code:
---------------
local oHrb, cCode
local cHBheaders1 := "~/hb32/include"
local cHBheaders2 := "d:\hb32\include"
cCode := MemoRead('debug.prg')
oHrb = HB_CompileFromBuf( cCode, .T., "-m", "-q2", "-I" + cHBheaders1, "-I" + cHBheaders2, "-I" + hb_GetEnv( "HB_INCLUDE" ), hb_GetEnv( "HB_USER_PRGFLAGS "))
---------------
It displays the following error message:
Error COMPILER/1 Statement not allowed outside of procedure or function: line: 2
If I compile with harbour:
harbour -m debug.prg
The message is as follows:
Compiling'debug.prg'...
Lines 78, Functions/Procedures 2
Generating C source output to'debug.c'... Done.
If I change the parameters:
harbour -n debug.prg
The message is as follows:
Compiling'debug.prg'...
debug.prg(2) Error E0001 Statement not allowed outside of procedure or function
1 error
I have a question, does the function HB_CompileFromBuf() have preset parameters?
Is it'-n'? Can it be removed?