Prof A Olowofoyeku (The African Chief) wrote:
If you have something like this: function foo : integer; external 'bar' name 'foo'; you get a warning that the library name in 'external' is ignored. Is it possible, instead of ignoring the library name, to generate an implicit call to link it? For example, the example above would resolve to an implicit '-lbar' (i.e., it would be the equivalent of '{$l bar}').
Is this feasible, and is there any reason why it would be a bad idea?
I think we've discussed it before. Basically, I agree. However, such a feature has to be implemented on the linker-call level, i.e., via automake or GP (or hand-written Makefiles which is the individual author's responsibility). I have no plans to do any further work on automake. I'd like to do it in GP when I get to it. But it isn't exactly trivial, also due to Delphi's complex syntax here:
BTW: this causes a compiler error: const barlib = 'bar'; function foo : integer; external barlib name 'foo';
Supporting expressions instead of string constant here is a bit tricky. It might be feasible for the linker name. With the library name with GP it will get even harder. I might look at it sometime, but it's not really high priority to me ATM. (If you need something similar, you can probably use macros which should work here.)
Frank