[fpc-pascal] Please someone explain this to me
Sven Barth
pascaldragon at googlemail.com
Wed Feb 10 08:06:42 CET 2016
Am 10.02.2016 00:32 schrieb "Ralf Quint" <freedos.la at gmail.com>:
>
> On 2/9/2016 2:58 PM, Anthony Walter wrote:
>>
>> I really don't like the include files with Lazarus and Free Pascal for
the following reason:
>>
>> How the **** am I supposed to know which file is including an include
file?
>>
>> Often times I am trying to find a function or class or some other
identifier and I search files on disk for the name. Then it turns out the
identifier is in some include file. Often the include file doesn't have any
information to which unit it belongs and I am then forced to search further
for other files which reference the include file. It's a mess.
>>
>> In this issue http://mantis.freepascal.org/view.php?id=29599 Juha is
asking how I was able to compile my patch without using the dynlibs unit.
Sure enough I am not using the dynlibs unit, but on my system it compiles.
When I control click the LoadLibrary identifier in my Unity patch, Lazarus
brings up an include file with LoadLibtary declared, but I have no idea
which unit is including it (remember I'm not using unit dynlibs).
>>
>> So my question is, how do the rest of you deal with include files and
locating the unit including them? And also can this system for including
files be better implemented, for example by some IDE feature to figure this
out for you and displaying the "owning" units.
>>
> It seems to me as if you are approaching the problem from the wrong end,
which has your search end up in the include file instead of the associated
unit.
>
> I had only a cursory look at your problem and it seems you just went
straight to the Linux related LoadLibrary function instead of indeed using
the dynlibs unit, which exist for the purpose of creating a cross-platform
way of using dynamically loaded libraries (hence the name). You seem to
just ignore the fact that this is a highly OS depended functionality and
seemed to have taken interest only in the Linux related part of what ever
your initial problem is/was and used that portion of the code in stead of
making use of the dynlibs unit.
Since 3.0.0 the DynLibs unit is only needed to initialize the dynamic
library manager on platforms that don't have it in System (like Windows
does). The related functions (e.g. LoadLibrary() ) have been moved to
System as that functionality is required both for dynamic packages and
delay loading. (Note: DynLibs still contains the functions, but they
forward to the System ones).
Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160210/2b8d73ab/attachment.html>
More information about the fpc-pascal
mailing list