www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Derelict linking (Debian + derelict + dmd 2.062)

reply "mimi" <4.deniz.z.z gmail.com> writes:
Hi!

I am trying to add SDL support to my project. libderelict-dev 
installed into my Debian and I am just added "import 
derelict.sdl2.sdl;". And caused:

dmd -I/usr/include/dmd/ -unittest -g -debug -debug=osmpbf 
-L-lDerelictUtil -L-lDerelictSDL2 -L-ldl  -ofmain libosmpbfd.a 
math/rtree2d.d math/geometry.d math/graph.d pb_encoding.d main.d
/usr/lib/x86_64-linux-gnu/libDerelictSDL2.a(sdl_1_698.o):(.data+0x60): 
undefined reference to 
`_D8derelict4util6loader15SharedLibLoader7__ClassZ'
/usr/lib/x86_64-linux-gnu/libDerelictSDL2.a(sdl_1_698.o):(.rodata+0x41f0): 
undefined reference to 
`_D8derelict4util6loader15SharedLibLoader4loadMFZv'
/usr/lib/x86_64-linux-gnu/libDerelictSDL2.a(sdl_1_698.o):(.rodata+0x41f8): 
undefined reference to 
`_D8derelict4util6loader15SharedLibLoader4loadMFAyaZv'
/usr/lib/x86_64-linux-gnu/libDerelictSDL2.a(sdl_1_698.o):(.rodata+0x4200): 
undefined reference to 
`_D8derelict4util6loader15SharedLibLoader4loadMFAAyaZv'
/usr/lib/x86_64-linux-gnu/libDerelictSDL2.a(sdl_1_698.o):(.rodata+0x4208): 
undefined reference to 
`_D8derelict4util6loader15SharedLibLoader6unloadMFZv'
/usr/lib/x86_64-linux-gnu/libDerelictSDL2.a(sdl_1_698.o):(.rodata+0x4210): 
undefined reference to 
`_D8derelict4util6loader15SharedLibLoader8isLoadedMFNdZb'
/usr/lib/x86_64-linux-gnu/libDerelictSDL2.a(sdl_1_698.o):(.rodata+0x4220): 
undefined reference to 
`_D8derelict4util6loader15SharedLibLoader10loadSymbolMFAyaZPv'
/usr/lib/x86_64-linux-gnu/libDerelictSDL2.a(sdl_1_698.o):(.rodata+0x4228): 
undefined reference to 
`_D8derelict4util6loader15SharedLibLoader3libMFNdZS8derelict4util9sharedlib9SharedLib'
/usr/lib/x86_64-linux-gnu/libDerelictSDL2.a(sdl_1_698.o):(.rodata+0x4230): 
undefined reference to 
`_D8derelict4util6loader15SharedLibLoader8bindFuncMFPPvAyabZv'
/usr/lib/x86_64-linux-gnu/libDerelictSDL2.a(sdl_1_698.o): In 
function 
`_D8derelict4sdl23sdl18DerelictSDL2Loader6__ctorMFZC8derelict4sdl23sdl18DerelictSDL2Loader':
../derelict/sdl2/sdl.d:(.text._D8derelict4sdl23sdl18DerelictSDL2Loader6__ctorMFZC8derelict4sdl23sdl18Derel
ctSDL2Loader+0x1b): 
undefined reference to 
`_D8derelict4util6loader15SharedLibLoader6__ctorMFAyaZC8derelict4util6loader15SharedLibLoader'
collect2: error: ld returned 1 exit status
--- errorlevel 1
make: *** [main] Error 1

What is it? Can anyone help?
Jun 07 2013
parent reply "Mike Parker" <aldacron gmail.com> writes:
On Saturday, 8 June 2013 at 00:27:36 UTC, mimi wrote:
 Hi!

 I am trying to add SDL support to my project. libderelict-dev 
 installed into my Debian and I am just added "import 
 derelict.sdl2.sdl;". And caused:

 dmd -I/usr/include/dmd/ -unittest -g -debug -debug=osmpbf 
 -L-lDerelictUtil -L-lDerelictSDL2 -L-ldl  -ofmain libosmpbfd.a
Looks like a problem with the order in which the libraries are specified on the command line. Swap them like so: "-L-lDerelictSDL2 -L-lDerelictUtil" and see if that does it for you.
Jun 07 2013
parent "mimi" <4.deniz.z.z gmail.com> writes:
Thanks! It worked!

On Saturday, 8 June 2013 at 03:44:22 UTC, Mike Parker wrote:
 On Saturday, 8 June 2013 at 00:27:36 UTC, mimi wrote:
 Hi!

 I am trying to add SDL support to my project. libderelict-dev 
 installed into my Debian and I am just added "import 
 derelict.sdl2.sdl;". And caused:

 dmd -I/usr/include/dmd/ -unittest -g -debug -debug=osmpbf 
 -L-lDerelictUtil -L-lDerelictSDL2 -L-ldl  -ofmain libosmpbfd.a
Looks like a problem with the order in which the libraries are specified on the command line. Swap them like so: "-L-lDerelictSDL2 -L-lDerelictUtil" and see if that does it for you.
Jun 07 2013