comp.lang.ada
 help / color / mirror / Atom feed
* Bindings for DLL with GNAT
@ 2004-03-25 12:59 Bernd Specht
  2004-03-25 19:30 ` Szymon Guz
  0 siblings, 1 reply; 2+ messages in thread
From: Bernd Specht @ 2004-03-25 12:59 UTC (permalink / raw)


Hello,
 
I've some trouble with generating bindings for a dll (GNAT on Win2k).

I've written a spec containing the definitions and added:
pragma import (stdcall, XY, "XY");

Then I generated a import-library as described in gnat_ug.

When linking, the linker tells me, it miss a "XY@8". So I added the "@8" in 
the ".def"-file. Then link works, but at runtime I get a message "XY@8" not 
found in dll.

In fact, the name in the DLL is without "@8" (but the linker expects it).

Any ideas?

Regards,
Bernd



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bindings for DLL with GNAT
  2004-03-25 12:59 Bindings for DLL with GNAT Bernd Specht
@ 2004-03-25 19:30 ` Szymon Guz
  0 siblings, 0 replies; 2+ messages in thread
From: Szymon Guz @ 2004-03-25 19:30 UTC (permalink / raw)


Bernd Specht wrote:
> Hello,
>  
> I've some trouble with generating bindings for a dll (GNAT on Win2k).
> 
> I've written a spec containing the definitions and added:
> pragma import (stdcall, XY, "XY");
> 
> Then I generated a import-library as described in gnat_ug.
> 
> When linking, the linker tells me, it miss a "XY@8". So I added the "@8" in 
> the ".def"-file. Then link works, but at runtime I get a message "XY@8" not 
> found in dll.
> 
> In fact, the name in the DLL is without "@8" (but the linker expects it).
> 
> Any ideas?
> 
> Regards,
> Bernd

AFAIK the problem is that during compilation GNAT changes the sign '@' 
into '__0040' or sth like that. You have to change it in the file that 
you get when you compile the Ada file in which you have this pragma Import.

Szymon Guz



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-25 19:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-25 12:59 Bindings for DLL with GNAT Bernd Specht
2004-03-25 19:30 ` Szymon Guz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox