Page 1 of 1

duplicate function name in different prgs

Posted: Thu Jun 23, 2016 5:02 pm
by Anand
I have a project with two reports. I first made one report rep_firstcn.prg which has functions like opendbf, closedbf, reportprint etc. All these functions are not "static" i.e. they are accessible from other prgs. Now I create another report rep_lastcn.prg which too have the above functions and not in "static" mode.

Now if I compile the same two prgs in Clipper I get "Function already exist in XX" error, but HbMG is not giving any error. It is executing the wrong functions. I should make the functions "Static" but my query is,

How can I make HbMG to give the "Function already exist in XX" error message, so that I get to know which prgs to correct.

I could not find the solution in searching this forum and also googling. Please guide.

Regards,

Anand

Re: duplicate function name in different prgs

Posted: Thu Jun 23, 2016 8:28 pm
by andyglezl
Hola

Porque 2 .prg con las mismas funciones ?
Puedes hacer solo uno y enviar como parametros lo que sea diferente.
( dbf, Titulo, etc. )
------------------------------------------------------------------------------------
Hello
Why 2 .prg with the same functions?
You can do just a prg and send as parameters that is different.
(Dbf, Title, etc.)

Re: duplicate function name in different prgs

Posted: Thu Jun 23, 2016 11:51 pm
by Carlos Britos
Hi
Anand wrote:
How can I make HbMG to give the "Function already exist in XX" error message, so that I get to know which prgs to correct.
Anand
MinGW show you the duplicate function while compiling, in fact show you an error at compilation time. Except if you set the mingw param to avoid it. I don't remember a this moment the name of the parameter

Re: duplicate function name in different prgs

Posted: Sun Jun 26, 2016 11:47 am
by Anand
Hi andyglezl and Carlos Britos,

Thanks for your reply.

I have attached a sample project files print_report.zip. It has two report prgs namely test2.prg and test3.prg. Both use same named functions to open and close dbf "openfile" and "closefile".

When I run build.bat, it does not give error "duplicate "openfile" function" and the exe calls the "openfile" from test2.prg from test3.prg

Please compile and run the exe to understand the problem. I have tried to make it as simple as possible. There may be some switches for it which I do not know. Please guide.

Please note I know that by making "Static" this problem will be solved, but I want the compiler to warn me as when I work with large project files I copy prgs from other projects which may have similar function names.

Regards,

Anand

Re: duplicate function name in different prgs

Posted: Sun Jun 26, 2016 1:53 pm
by Rathinagiri
When I had imported your project to HMG 3.4.3 IDE and compiled, I got the error of duplicate function names. Don't you get that?

Re: duplicate function name in different prgs

Posted: Mon Jun 27, 2016 8:49 am
by Anand
Hi Rathinagiri Sir,

No, I did not get error mesg.

I ran the build.bat file and no error. Also the my IDE did not give any error, see screen shot attached.

But I noted that my ide is showing version 1.3.0. Also MiniGUI version is "Harbour MiniGUI Extended Edition 16.04"
I think I have old version of Harbour and MiniGUI which is causing the problem. Please guide me which link should I use to download the correct version.

Regards,

Anand

Re: duplicate function name in different prgs

Posted: Mon Jun 27, 2016 8:58 am
by Rathinagiri
I am using the HMG official IDE. I think you are saying about HMG Extended.

Re: duplicate function name in different prgs

Posted: Mon Jun 27, 2016 11:13 am
by Anand
Thanks a lot Sir :D

Yes I was using MiniGUI Extended assuming it was the latest version of HMG.
I downloaded hmg.3.4.3 from link in home page of this forum and installed. The ide gave error and also after I made changes to build.bat file, pointing to it, it gave error. Now I can relax. Thanks again.

I will use this version now onward.

Just a query what is MiniGUI Extended then ? It can be found Googling for harbour and I thought that was the version to use.

Regards,

Anand

Re: duplicate function name in different prgs

Posted: Mon Jun 27, 2016 4:30 pm
by Rathinagiri
MiniGUI Extended is also a Parallel version of HMG developed and maintained by another group of people having our member Grigory Filatov as the lead developer. It is also another variety of HMG. Regarding the IDE of MiniGUI Extended, you can ask your doubts in their yahoo group.