Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Harbour .exe problem

Status
Not open for further replies.

lzulli

Programmer
Mar 4, 2004
22
0
0
VE
I just compiled my Clipper program with Harbour using Hbmake utility. I get an .exe but when I try to run it this opens an close in a fraction of a second. Anybody can tel me how I do wrong ?
 
Did you create/add a function Main() in the main module that wraps the main execution part of that source? Clipper added an implicit main to any app.

You can guard that with #ifdef's like this:
Code:
#ifdef __HARBOUR__
function Main()
#endif
{original code goes here}
#ifdef __HARBOUR__
return(nil)
#endif

HTH
TonHu
 
Thanks TonHu, I tried this but don't work. When I use HBMake have I to select with F5 all my .prg or the main module only ? If I select all the .prg I get lots of errors and no code is generated. My program (Clipper '87 - 5.2b) compiles well in Clipper and suppose must compile in Harbour without modifications or not ?
This is what I get:

Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
pnl.c:
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_main' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Error: Unresolved external '_hb_vmProcessSymbols' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_SCROLL' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_SETPOS' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_READKILL' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_REPLICATE' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_SPACE' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN___MVPUBLIC' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_SETCURSOR' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_UPPER' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DISPBOX' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DEVPOS' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DEVOUT' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_INKEY' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DATE' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_MONTH' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_ROW' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_COL' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_AADD' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN___GET' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_READMODAL' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_YEAR' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_QOUT' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_QQOUT' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN___KEYBOARD' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN___RUN' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_SETCOLOR' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN___QUIT' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN___SETCENTURY' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_SET' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_ISCOLOR' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_MEMORY' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DBSELECTAREA' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DEVOUTPICT' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_TIME' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_ORDLISTCLEAR' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_ORDLISTADD' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DBGOTOP' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_EOF' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DBSEEK' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DBUNLOCK' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DBSKIP' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DBUNLOCKALL' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN___DBZAP' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_TYPE' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_FERASE' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DBCREATEINDEX' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN___DBPACK' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DBCLOSEAREA' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DBF' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DTOC' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN___COPYFILE' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_LASTKEY' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_CTOD' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DBDELETE' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DBGOTO' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DBCLOSEALL' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_FILE' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN___MVPRIVATE' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DBUSEAREA' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_NETERR' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_FLOCK' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_RLOCK' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DBAPPEND' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_SUBSTR' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_VAL' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_STR' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_EMPTY' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_FOUND' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DELETED' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DOW' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DAY' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_ROUND' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_INT' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN___EJECT' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_DBSETFILTER' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_PROW' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_ISPRINTER' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_SETPRC' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_HB_FUN_LTRIM' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
Error: Unresolved external '_hb_vmExecute' referenced from C:\BRIEF\NOMINAX\OBJ\PNL.OBJ
xHarbour Compiler build 0.99.50 (SimpLex)
Copyright 1999-2005, Compiling 'PNL.PRG'...

PNL.PRG(10) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(3) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(4) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(5) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(6) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(7) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(8) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(9) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(10) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(11) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(12) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(13) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(14) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(15) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(16) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(17) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(18) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(19) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(20) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(21) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(22) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(23) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(24) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(25) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(26) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(27) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(28) Error E0001 Statement not allowed outside of procedure or function

VARIAN.CH(29) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(13) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(15) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(16) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(17) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(18) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(19) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(20) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(21) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(22) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(23) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(25) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(26) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(27) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(29) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(31) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(32) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(33) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(34) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(35) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(36) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(37) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(39) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(40) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(41) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(44) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(45) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(46) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(47) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(49) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(50) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(51) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(52) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(53) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(56) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(57) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(58) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(59) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(61) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(62) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(63) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(64) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(65) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(66) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(67) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(68) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(69) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(71) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(72) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(73) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(74) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(75) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(76) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(77) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(78) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(79) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(80) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(81) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(82) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(83) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(84) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(85) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(86) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(87) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(88) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(89) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(90) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(91) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(94) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(95) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(97) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(98) Error E0001 Statement not allowed outside of procedure or function

100
PNL.PRG(100) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(101) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(103) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(104) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(106) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(107) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(109) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(110) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(112) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(113) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(114) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(116) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(117) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(118) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(119) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(120) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(121) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(122) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(123) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(124) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(125) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(126) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(127) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(128) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(129) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(130) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(131) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(132) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(133) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(134) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(135) Error E0001 Statement not allowed outside of procedure or function

PNL.PRG(136) Error E0001 Statement not allowed outside of procedure or function
Compiling module 'SCREENN1.prg'...

SCREENN1.prg(3) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(4) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(6) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(7) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(8) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(9) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(10) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(11) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(12) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(13) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(14) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(15) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(16) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(18) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(19) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(20) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(21) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(22) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(23) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(24) Error E0001 Statement not allowed outside of procedure or function

SCREENN1.prg(25) Error E0001 Statement not allowed outside of procedure or function

152 errors

No code generated

Help me if you can !

Rgds,
Lzulli
 
Hi Lzulli,

Does putting:
Procedure Pnl
as the first line of PNL.PRG change anything.

Also after your variable declarations add the line:
MEMVAR GetList
Should get rid of some of the Unresolved External Warnings but the warings will not prevent the build. Any error will.

Regards,

Mike
 
Is your LIB setting (environment) referencing the xHarbour LIB directory? obviously it can't find the RTL.LIB (and other libs) from xharbour

HTH
TonHu
 
Thanks "mspratt" and "TonHu",
now I have advanced a lot. I understand that the Main module must have:
PROCEDURE MAIN()
...
RETURN (NIL)

and the modules called by DO MODULE1 must have:

PROCEDURE MODULE1
...
RETURN

Is that OK ?

After that HBAKE compiled all my modules but at the end I get lot of WARNINGS running fast up the screen like this:

WARNING: PUBLIC SYMBOL 'HB_FUN_CONGE' DEFINED IN BOTH MODULE C:\PNL.OBJ AND C:\MODULE1.OBJ

What could be wrong ? Thanks for your help !

Lzulli


 
Hi Lzulli,

Are you getting a .exe now?

The warnings I get are usually because I have used a variable without declaring it.

Perhaps you are getting an error you can't see.

Try: HBMAKE ProgramName > Info.txt
Search Info.txt for error statements.

Regards,

Mike
 
Thanks Mike I will try that.

Rgds,

Lzulli
 
Hi Mike and TonHu,

I finally get a working .exe compiled with:

HBMAKE Program.BC > Info.txt

The info.txt is a 3.8 Mb file full of Warnings, but my program works fine, can I use it or I have to resolve all of warnings (public symbols defined in 2 modules).

Thanks again

Lzulli

 
Hi Lzulli,

Code:
PROCEDURE MODULE1
MEMVAR GrtFile

At the beginning of each PROCEDURE (After variable declarations) should get rid of some of the warnings.

Regards,

Mike
 
You can change the warninglevels on the xHarbour compiler, but I don't know the switches exactly, try HARBOUR -? to display them all.

The warning about 'HB_FUN_CONGE' means you have both a function called CONGE defined in PNL.PRG and in MODULE.PRG, did you #include PNL into MODULE1 or the other way around? Coould also be you have a duplicate (but possibli different) function, but they should get a STATIC prefix (STATIC FUNCTION CONGE) so it gets to be local to each source-file.

The proper way of avoiding these warnings is to declare all variables used in the application as MEMVAR, PRIVATE, LOCAL, PUBLIC etc. but that is probably a lot of work ;-)

Note: Harbour compiled .PRG sources get HB_FUN_ prefixes on their functionnames during translation to C language to avoid functionname clashes with C-level functions.

HTH
TonHu
 
Thanks for your cooperation Mike and TonHu, I will make more tests to avoid those warnings.
Rgds,
Lzulli
 
Hi TonHu,
I have a Procedure called CONGE that is unique and is called from many other Procedures. Have I call them differently ?
I don't understand what you mean with: "did you #Include PNL into Module1 or the other way around?" Can you explain it better ?
PNL is my Procedure Main().
How can I call a Procedure that is called from many modules?
Thanks
Lzulli
 
I found the origin of Warnings. I must call a procedure like this:

Myprocedure1()

in place of:

Do Myprocedure1

This eliminate all the warnings and the .exe is reduced a lot in size and works fine.

 
Ah, great you solved that.

Sorry I didn't respond sooner, been on a short vacation ;-)

HTH
TonHu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top