"Peter Hend�n" wrote in message news:%lfx7.6$_o6.503@newsc.telia.net... > > When I try to declare it StdCall instead of C, I am > not able to link it. Whatever I put in the .DEF file > it comes out wrong. I get from the last gnatlink step > in gnatdll: > > mydll.exp(.edata+0x34):fake: undefined reference to `Foobar' Have you tried specifying the link name in the pragma? Something like this: pragma Export (Stdcall, Foobar, "Foobar", Link_Name => "Foobar"); may work (not tested). > > -- > Peter Hend�n http://www.algonet.se/~phenden > ICQ: 14672398 > Teknisk Dokumentation AB http://www.tdab.com Sergey Koshcheyev.