[Lazarus] Strange dependency of units

Jürgen Hestermann juergen.hestermann at gmx.de
Sun Apr 1 11:20:49 CEST 2012


Mattias Gaertner schrieb:
 > AFAIR Turbo Pascal was pretty simple. I really liked it.
 > It supported only one target platform and the OOP came with Delphi.

OOP was already implemented in Borland Pascal.


 > Compare the compiler flags of TP and FPC. TP is a toy compared to FPC.

But what has all this to do with the concept of packages? The concepts 
used in TP where enough to allow arbitrary complex applications. And my 
main critic about all this is, that even when new concepts are 
introduced they should be rock solid. This looks more like a design study.


 > The normal user creates a LCL application and everything is setup for 
him.

That's exactly what I did. I used Larazus to create a console 
application. I then added my general purpose unit to the uses clause. 
Then compile failed with an error message that had nothing to do with my 
program or unit.


 > You didn't use the tools, but instead set up your project manually.

Not true.


 > And now you expect that the compiler/IDE magically scans your brain to
 > find out what your intention was and complete what you have started?

No. But you expect me to scan the brain of the programmers of the LCL to 
find out why I get this error message.


 >> Shouldn't these dependencies somehow be handled by the compiler/linker?
 >
 > They are handled automatically if you let the IDE help you.

It seems they are not.


 >> Why is the programmer bothered with it?
 >
 > Because you choose to.

I did not.


 > I bet most Lazarus users have never seen this linker error.

I don't know. But still what I did was a standard thing:

*) Write a unit
*) Create a program (via Lararus) that uses the unit (which I use in 
nearly all programs)

What is wrong with this?


To sum it up:
If I use a unit GRIDS in a unit and a program uses this unit how should 
I know that this program has to use the unit INTERFACES? Why is this 
unit not required in my unit but in my program? That's completely 
rediculous. Why does the existing rock solid unit concept no longer 
work? It seems some other concept has broken it.






More information about the Lazarus mailing list