Dynamically calling shared objects from statically build executable allowed
Andre Pany
andre at s-e-a-p.de
Mon Feb 10 19:00:36 UTC 2020
On Monday, 10 February 2020 at 13:14:50 UTC, Ernesto Castellotti
wrote:
> On Monday, 10 February 2020 at 04:41:31 UTC, Andre Pany wrote:
>> Is this a bug with LDC and DMD, or is it not allowed
>> to dynamically call a SO from a statically build executable on
>> linux
>
> On Unix systems it is not possible to dynamically load a
> library shared by a static executable, I don't know if it works
> differently for Windows.
>
> This is because it is absolutely necessary to link libdl
> dynamically, you cannot link static.
>
> For GNU/Linux systems there is this alternative to dlopen/dlsym
> that does not require dynamic link:
> https://www.gnu.org/software/libtool/manual/html_node/Dlpreopening.html
This is a topic I almost have no knowledge, therefore a question.
If I understand this StackOverflow question correctly, it is
possible to call dynamically a shared object from a static
library (with dlopen):
https://stackoverflow.com/questions/17862272/dlopen-a-dynamic-library-from-a-static-library-linux-c
But I understand from you it is not possible dynamically call a
shared object from a static executable.
Therefore it works for static libraries but not for statically
executables?
Kind regards
Andre
More information about the Digitalmars-d-learn
mailing list