Dynamic library loading gives error about importing a module
Ali Çehreli
acehreli at yahoo.com
Wed Feb 19 13:38:18 PST 2014
On 02/19/2014 01:45 AM, Tolga Cakiroglu wrote:
> I have written a programme and a library under Linux. When programme is
> run, it tries to load the library. Both the programme code and the
> library imports a module as "apps.common.lib.config". Now, when I run
> the programme, following error is seen:
>
> Fatal Error while loading 'dll/lib.so':
> The module 'apps.common.lib.config' is already defined in
'./bin/app'.
> make: *** [debug] Error 139
>
>
> Why am I not allowed to import same module in to different code files?
> Shouldn't they be separate?
Simply "import"ing should work; doing that should not bring definitions
to the code. However, one side should also include the module during its
build.
Have you included the module on both the program's and library's builds?
Ali
More information about the Digitalmars-d-learn
mailing list