Derelict linking (Debian + derelict + dmd 2.062)

2013-06-07 Thread mimi

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__ctorMFZC8derelict4sdl23sdl18DerelictSDL2Loader+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?


Re: Bug or feature?

2013-05-27 Thread mimi
Well, how you can reduce the long ugly name in this case? In the 
real function I mentioned it so many times.


Re: Bug or feature?

2013-05-27 Thread mimi

On Monday, 27 May 2013 at 10:17:01 UTC, Namespace wrote:

void foo( S s )
{
auto local = this.bigUglyName;
auto b = s.bigUglyName;

writeln( bigUglyName (AKA local)=, local,  b=, b );
}

:P


By the way, yes. Thanks for that, I'm stupid today.


Re: How do you guys debug large programs?

2013-05-27 Thread mimi

On Monday, 27 May 2013 at 19:55:57 UTC, Gary Willoughby wrote:
This is quite an open ended question but i wondered how you 
guys debug your D programs (i'm talking about stepping through 
code, setting breakpoints, etc). The lack of nice IDE's with 
integrated debuggers is worrying when working with D but up 
until now i haven't need one.


Now i've started to write much larger programs, i'm wondering 
which debuggers do you use? Especially using Linux.


I am use Geany + gdb in Linux. A little frustrating that the 
Geany's GUI don't shows CPU registers, but .


Need to compile with this arguments for working with gdb:

dmd -unittest -gc -debug -debug=5


Re: Bug or feature?

2013-05-27 Thread mimi

On Monday, 27 May 2013 at 11:32:46 UTC, Maxim Fomin wrote:

On Monday, 27 May 2013 at 10:07:49 UTC, mimi wrote:
Well, how you can reduce the long ugly name in this case? In 
the real function I mentioned it so many times.


By not making the name ugly big.


Other people do.

In addition, sometimes you want to cut long nested queries such 
as:


auto numOfPixelsDisplayed = Table.getItems( 
Scene.getObjectsArray() ).prepareForDisplay( type.GL 
).showScene();


lookup fields struct

2013-05-26 Thread mimi

Hi!

I am want to get list of fields types and offsets in struct by
the template.

I.e., lookup through this struct:

struct S {

int a;
string b;
someptr* c;

};

template Lookup!( S )(); returns something as:

field #0, int, offset 0
field #1, string, offset 8,
field #2, someptr, offset 16

How I can do this?


Bug or feature?

2013-05-26 Thread mimi

import std.stdio;

struct S
{
int bigUglyName;

void foo( S s )
{
alias bigUglyName local;
alias s.bigUglyName b;

writeln( bigUglyName (AKA local)=, local,  b=, b );
}
}

void main()
{
S s1;
S s2;

s1.bigUglyName = 1;
s2.bigUglyName = 2;

s1.foo( s2 );
}


returns to console:
bigUglyName (AKA local)=1 b=1

Why? I am expected that b=2


Re: lookup fields struct

2013-05-26 Thread mimi

Wow! thanks!