Problems linking libdl?

Mike Wey mike-wey at example.com
Mon Feb 20 13:26:58 PST 2012


On 02/20/2012 09:49 PM, simendsjo wrote:
> On Mon, 20 Feb 2012 21:41:45 +0100, simendsjo <simendsjo at gmail.com> wrote:
>
>>
>> I've tried the following using dmd 58 and trunk - both -m64 on kubuntu.
>> Any idea what I'm doing wrong?
>>
>> import std.loader;
>> void main(string[] args)
>> {
>> auto res = ExeModule_Init();
>> assert(res == 0);
>> scope(exit) ExeModule_Uninit();
>> auto mod = ExeModule_Load("./libtcod.so");
>> }
>>
>> $ dmd-trunk -v -L-ldl so.d
>>
>> gcc so.o -o so -m64 -ldl -Xlinker
>> -L/home/simendsjo/code/dmd-trunk/build/lib64 -Xlinker
>> -L/home/simendsjo/code/dmd-trunk/build/lib -Xlinker
>> --no-warn-search-mismatch -Xlinker --export-dynamic -lphobos2
>> -lpthread -lm -lrt
>....
> I get the same error using gdc-4.6

The problem is that -ldl should appear after -lphobos2 in the arguments 
passed to gcc.

-- 
Mike Wey


More information about the Digitalmars-d-learn mailing list