Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-11

Fatal: Circular unit reference between units

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Eric Kom

Good day all,

Please I got a problem regarding units. To use components from unit1 called mainWindow, I included the header unit1 inside unit2 called loginScholarly. During build process, the above message occurred:

loginscholarly.pas(19,42) Fatal: Circular unit reference between
loginScholarly and mainWindow

Thanks

Kind Regards Eric Kom System Administrator - Metropolitan College _________________________________________ / You are scrupulously honest, frank, and \ | straightforward. Therefore you have few | \ friends. / ----------------------------------------- \ \ .--. |o_o | |:_/ | // \ \ (| Kom | ) /'\_ _/`\ \___)=(___/ 2 Hennie Van Till, White River, 1240 Tel: 013 750 2255 | Fax: 013 750 0105 | Cell: 078 879 1334 | www.kom.za.net | www.kom.za.org | www.erickom.co.za Key fingerprint: 513E E91A C243 3020 8735 09BB 2DBC 5AD7 A9DA 1EF5

Reply by email

Unknown author
to Eric Kom
Eric Kom wrote 8 lines
Good day all, Please I got a problem regarding units. To use components from unit1 called mainWindow, I included the header unit1 inside unit2 called loginScholarly. During build process, the above message occurred: loginscholarly.pas(19,42) Fatal: Circular unit reference between loginScholarly and mainWindow

Well, you're not supposed to do this. Probably mainWindow already uses loginScholarly.

In general, units should not use each other, it is bad design.

Now, you can solve this by moving one of the units from the interface uses section to the implementation section. You'll have to decide which one.

In general, however, it is better to move common parts to a separate unit, and let both units use that third unit.

Michael.

Show quoted text 38 lines
Thanks -- Kind Regards Eric Kom System Administrator - Metropolitan College _________________________________________ / You are scrupulously honest, frank, and \ | straightforward. Therefore you have few | \ friends. / ----------------------------------------- \ \ .--. |o_o | |:_/ | // \ \ (| Kom | ) /'\_ _/`\ \___)=(___/ 2 Hennie Van Till, White River, 1240 Tel: 013 750 2255 | Fax: 013 750 0105 | Cell: 078 879 1334 | www.kom.za.net | www.kom.za.org | www.erickom.co.za Key fingerprint: 513E E91A C243 3020 8735 09BB 2DBC 5AD7 A9DA 1EF5 -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Eric Kom
to Unknown author
Show quoted text 21 lines
On Wed, 21 Nov 2012, Eric Kom wrote: > Good day all, > > Please I got a problem regarding units. To use components from unit1 > called mainWindow, I included the header unit1 inside unit2 called > loginScholarly. During build process, the above message occurred: > > loginscholarly.pas(19,42) Fatal: Circular unit reference between > loginScholarly and mainWindow Well, you're not supposed to do this. Probably mainWindow already uses loginScholarly. In general, units should not use each other, it is bad design. Now, you can solve this by moving one of the units from the interface uses section to the implementation section. You'll have to decide which one.

Thanks, it works. I butter use implementation section since it will give me hard work by creating another unit file at the moment.

I will think about that in the next project

Show quoted text 52 lines
In general, however, it is better to move common parts to a separate unit, and let both units use that third unit. Michael. > > Thanks > > -- > Kind Regards > > Eric Kom > > System Administrator - Metropolitan College > _________________________________________ > / You are scrupulously honest, frank, and \ > | straightforward. Therefore you have few | > \ friends. / > ----------------------------------------- > \ > \ > .--. > |o_o | > |:_/ | > // \ \ > (| Kom | ) > /'\_ _/`\ > \___)=(___/ > > 2 Hennie Van Till, White River, 1240 > Tel: 013 750 2255 | Fax: 013 750 0105 | Cell: 078 879 1334 > | > www.kom.za.net | www.kom.za.org | www.erickom.co.za > > Key fingerprint: 513E E91A C243 3020 8735 09BB 2DBC 5AD7 A9DA 1EF5 > > > -- > _______________________________________________ > Lazarus mailing list > > http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus > -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Kind Regards Eric Kom System Administrator - Metropolitan College _________________________________________ / You are scrupulously honest, frank, and \ | straightforward. Therefore you have few | \ friends. / ----------------------------------------- \ \ .--. |o_o | |:_/ | // \ \ (| Kom | ) /'\_ _/`\ \___)=(___/ 2 Hennie Van Till, White River, 1240 Tel: 013 750 2255 | Fax: 013 750 0105 | Cell: 078 879 1334 | www.kom.za.net | www.kom.za.org | www.erickom.co.za Key fingerprint: 513E E91A C243 3020 8735 09BB 2DBC 5AD7 A9DA 1EF5

Reply by email

leledumbo
to Eric Kom: Please I got a problem regarding units. To use components from unit1 called mainWindow, I…

This is very likely to happen on user interface units. Decide: do you really need to have them using each other? or actually one can / must be started / opened / executed from the other? the problem might also happen if you tightly integrate data to the user interface. if you use 3rd unit / object / storage / whatever, the circular reference shouldn't happen.

Reply by email