Re: [fpc-pascal] External library name

2025-01-05 Thread Tony Whyman via fpc-pascal
Having stumbled over this problem last year, I now have a very simple rule (and which seems to work). If you are linking with an external static library (e.g. libssl.a) then you omit the external library name on each function call, but must include a $LINKLIB e.g. ($LINKLIB ssl.a}. If you ar

Re: [fpc-pascal] External library name

2025-01-05 Thread Marco van de Voort via fpc-pascal
Op 5-1-2025 om 13:23 schreef Marco van de Voort via fpc-pascal: Op 5-1-2025 om 10:43 schreef Jonas Maebe via fpc-pascal: That said, Darwin also uses two-level namespaces: https://blog.darlinghq.org/2018/07/mach-o-linking-and-loading-tricks.html#two-level-symbol-namespace . However, it doe

Re: [fpc-pascal] External library name

2025-01-05 Thread Marco van de Voort via fpc-pascal
Op 5-1-2025 om 10:43 schreef Jonas Maebe via fpc-pascal: That said, Darwin also uses two-level namespaces: https://blog.darlinghq.org/2018/07/mach-o-linking-and-loading-tricks.html#two-level-symbol-namespace . However, it does not do this through name mangling. The linker simply encodes in

Re: [fpc-pascal] External library name

2025-01-05 Thread Hairy Pixels via fpc-pascal
On Jan 5, 2025 at 6:45:49 PM, Tomas Hajny wrote: > As you might have noticed, it's simply a more general solution allowing > to cover all target platforms supporting dynamic libraries in a more or > less equal way. Yeah if DLLs have their own namepace and $LINKLIB doesn’t propagate to all exte

Re: [fpc-pascal] External library name

2025-01-05 Thread Tomas Hajny via fpc-pascal
On 2025-01-05 12:36, Hairy Pixels via fpc-pascal wrote: On Jan 5, 2025 at 4:43:39 PM, Jonas Maebe via fpc-pascal wrote: That said, Darwin also uses two-level namespaces: https://blog.darlinghq.org/2018/07/mach-o-linking-and-loading-tricks.html#two-level-symbol-namespace . However, it does n

Re: [fpc-pascal] External library name

2025-01-05 Thread Hairy Pixels via fpc-pascal
On Jan 5, 2025 at 4:43:39 PM, Jonas Maebe via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > That said, Darwin also uses two-level namespaces: > > https://blog.darlinghq.org/2018/07/mach-o-linking-and-loading-tricks.html#two-level-symbol-namespace > . However, it does not do this through

Re: [fpc-pascal] External library name

2025-01-05 Thread Jonas Maebe via fpc-pascal
On 05/01/2025 07:15, Hairy Pixels via fpc-pascal wrote: On Jan 5, 2025 at 11:53:36 AM, Adriaan van Os via fpc-pascal > wrote: This is a habit from the WIndows and Delphi world. In a one-levell namespace on MacOS, the dll name is superflouous. Note that Obj

Re: [fpc-pascal] External library name

2025-01-04 Thread Hairy Pixels via fpc-pascal
On Jan 5, 2025 at 11:53:36 AM, Adriaan van Os via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > This is a habit from the WIndows and Delphi world. In a one-levell > namespace on MacOS, the dll name > is superflouous. Note that ObjC symbols are always global ,which implies a > one-level n

Re: [fpc-pascal] External library name

2025-01-04 Thread Adriaan van Os via fpc-pascal
Hairy Pixels via fpc-pascal wrote: I see this pattern in C translated header often but I’ve honestly never understood it entirely. Why does this “cDllName" need to be added to every single function which you could just use {$linklib }? This is a habit from the WIndows and Delphi world. In