Page 1 of 1

Many Ambiguous reference error for the same source line ?

Posted: Wed May 27, 2009 10:49 am
by ohaldi
Hello why do I get so many Ambiguous reference error with the compiler.
Here 11 error for the same line!..

I have the following compiler options:
SET PATH=c:\HMG\mingw\bin;C:\HMG\MINGW\LIBEXEC\GCC\MINGW32\3.4.5
SET MINGW=c:\HMG\mingw
SET HRB_DIR=c:\HMG\harbour
SET OBJ_DIR=c:\HMG\KALGA32\obj\
SET MINIGUI_INSTALL=c:\HMG
%HRB_DIR%\bin\harbour kalga.prg -m -v -q -w2 -n -i%HRB_DIR%\include;%MINIGUI_INSTALL%\include; -o%OBJ_DIR%

Source line 61-65:
61 DEFINE STATUSBAR
62 STATUSITEM "Kalga Win Version 0.0"
63 CLOCK
64 DATE
65 END STATUSBAR

kalga.prg(65) Warning W0002 Ambiguous reference, assuming memvar: '_HMG_SYSDATA'
kalga.prg(65) Warning W0002 Ambiguous reference, assuming memvar: '_HMG_SYSDATA'
kalga.prg(65) Warning W0002 Ambiguous reference, assuming memvar: '_HMG_SYSDATA'
kalga.prg(65) Warning W0002 Ambiguous reference, assuming memvar: '_HMG_SYSDATA'
kalga.prg(65) Warning W0002 Ambiguous reference, assuming memvar: '_HMG_SYSDATA'
kalga.prg(65) Warning W0002 Ambiguous reference, assuming memvar: '_HMG_SYSDATA'
kalga.prg(65) Warning W0002 Ambiguous reference, assuming memvar: '_HMG_SYSDATA'
kalga.prg(65) Warning W0002 Ambiguous reference, assuming memvar: '_HMG_SYSDATA'
kalga.prg(65) Warning W0002 Ambiguous reference, assuming memvar: '_HMG_SYSDATA'
kalga.prg(65) Warning W0002 Ambiguous reference, assuming memvar: '_HMG_SYSDATA'
kalga.prg(65) Warning W0002 Ambiguous reference, assuming memvar: '_HMG_SYSDATA'
kalga.prg(65) Warning W0002 Ambiguous reference, assuming memvar: '_HMG_SYSDATA'
kalga.prg(65) Warning W0002 Ambiguous reference, assuming memvar: '_HMG_SYSDATA'
kalga.prg(65) Warning W0002 Ambiguous reference, assuming memvar: '_HMG_SYSDATA'

Many thanks in advance for any help.

Re: Many Ambiguous reference error for the same source line ?

Posted: Wed May 27, 2009 11:06 am
by gfilatov
ohaldi wrote:Hello why do I get so many Ambiguous reference error with the compiler.
Here 11 error for the same line!..

I have the following compiler options:
SET PATH=c:\HMG\mingw\bin;C:\HMG\MINGW\LIBEXEC\GCC\MINGW32\3.4.5
SET MINGW=c:\HMG\mingw
SET HRB_DIR=c:\HMG\harbour
SET OBJ_DIR=c:\HMG\KALGA32\obj\
SET MINIGUI_INSTALL=c:\HMG
%HRB_DIR%\bin\harbour kalga.prg -m -v -q -w2 -n -i%HRB_DIR%\include;%MINIGUI_INSTALL%\include; -o%OBJ_DIR%

Source line 61-65:
61 DEFINE STATUSBAR
62 STATUSITEM "Kalga Win Version 0.0"
63 CLOCK
64 DATE
65 END STATUSBAR

kalga.prg(65) Warning W0002 Ambiguous reference, assuming memvar: '_HMG_SYSDATA'
...
kalga.prg(65) Warning W0002 Ambiguous reference, assuming memvar: '_HMG_SYSDATA'

Many thanks in advance for any help.
Hello,

Don't worry :!: It is a warning only :!:

Solution:
Try to add on top (first line) of your module kalga.prg the following statement: :arrow:

MEMVAR _HMG_SYSDATA

I hope that helps :!:

Re: Many Ambiguous reference error for the same source line ?

Posted: Wed May 27, 2009 12:09 pm
by esgici
ohaldi wrote:Hello why do I get so many Ambiguous reference error with the compiler.
Hello Otto

OR :

Simply change

%HRB_DIR%\bin\harbour kalga.prg -m -v -q -w2 -n -i%HRB_DIR%\include;%MINIGUI_INSTALL%\include; -o%OBJ_DIR%

line to

%HRB_DIR%\bin\harbour kalga.prg -m -v -q -w0 -n i%HRB_DIR%\include;%MINIGUI_INSTALL%\include; -o%OBJ_DIR%


Regards

--

Esgici

Re: Many Ambiguous reference error for the same source line ?

Posted: Wed May 27, 2009 3:18 pm
by ohaldi
Hello,
I did the following change:

Code: Select all

%HRB_DIR%\bin\harbour kalga.prg -m -v -q -w0 -n i%HRB_DIR%\include;%MINIGUI_INSTALL%\include; -o%OBJ_DIR%
But now I don't see any compiler error anymore!

For example in this code the compiler do not show me that the variable vName is not declared with the switch w0.
STATIC FUNCTION Search()
// Local vName := ""
DEFINE WINDOW Win_Adr_Search ;
AT 300,300 ;
WIDTH 360 ;
HEIGHT 200 ;
TITLE 'Suchen' ;
MODAL NOSIZE
ON KEY ESCAPE ACTION Win_Adr_Search.Release
@ 30,10 LABEL LABEL_1 VALUE "Name"
@ 30,100 TEXTBOX TEXT_1;
VALUE vName WIDTH 200
END WINDOW
ACTIVATE WINDOW Win_Adr_Search
Return nil

I also tested w1,w2,w3 but no one give me a good result.
With clipper I didn't have had this problem!

Re: Many Ambiguous reference error for the same source line ?

Posted: Wed May 27, 2009 3:48 pm
by esgici
ohaldi wrote: For example in this code the compiler do not show me that the variable vName is not declared with the switch w0.
Hi Otto

"Variable not found" is a RTE ( run time error ) no compile time.

"w" compiler switch is "warning level" and digit associated it is "level"; so, "w0" mains "no produce any messages for warning errors".

You can also use "v" switch for "assume variables as M->"

You can get more information about compiler options / switchs by launching harbour.exe no without parameter or with '?' switch.

Of course declaring MEMVAR _HMG_SYSDATA as Grigory suggested, will be another good solution.

By the way, why you don't use IDE as project builder ?

Perhaps you like struggle with cryptic tools, such as .bat files :)

Regards

--

Esgici

Re: Many Ambiguous reference error for the same source line ?

Posted: Wed May 27, 2009 5:36 pm
by mol
maybe trivial question: Did you declare MAIN function?

Re: Many Ambiguous reference error for the same source line ?

Posted: Thu May 28, 2009 10:27 pm
by ohaldi
Hello
Try to add on top (first line) of your module kalga.prg the following statement:
MEMVAR _HMG_SYSDATA
I used the following solution. It is a good idea. It give me a view of all used variables.
By the way, why you don't use IDE as project builder ?
Because I can't include it in my Editor. And the output can't be captured.
With the batch file, the errors are displayed directly in the Editor. Then I only have to click on the error line to be placed directly on the correct prg and line.
Perhaps you like struggle with cryptic tools, such as .bat files
I like to understand what I do. I think it is interesting to know the possibility of a compiler.
Actually I have only a simple batch to compile all my prg's. I don't see the reason to install 34MB of
files (HMGIDE) if I don't use it.

Thanks to all for your help.