comp.lang.ada
 help / color / mirror / Atom feed
* Re: Using C dll from Ada95
  2000-01-11  0:00 Using C dll from Ada95 Philipp Boeni
@ 2000-01-11  0:00 ` Tucker Taft
  0 siblings, 0 replies; 2+ messages in thread
From: Tucker Taft @ 2000-01-11  0:00 UTC (permalink / raw)


Philipp Boeni wrote:
> 
> Hello everybody!
> I want to use a C-dll (created with Visual Studio 6) in Ada95 (Aonix IDE
> 7.1.2). Ada-Target: Command-Line App (Win32). The DLL uses the following
> function exportation: #define DLLExport extern "C" __cdecl (dllexport) and
> is NOT using any MFC enhancements...
> So what exactly do I need from the dll to build the Ada-project? If I use
> the "myDll.lib"-file (added to the Ada link-path), I receive a Link
> 1006-error (error seeking file, could not reach address...) and if I do not
> use the lib-file, the linker complains about an undefined external symbol
> (the exported function name, that a want to call from Ada)...

This is unfortunately a potentially compiler-specific issue.
In general, you will need to specify the convention in the
pragma Import as something like "dll_cdecl" rather than simply "C".
E.g.:
    function In_Some_DLL(X : ...) return ...;
    pragma Import(Convention => dll_cdecl, Entity => In_Some_DLL,
      External_Name => "in_some_dll");

> 
> Thanks for any help....
> 
> Philipp Boeni, University of Applied Sciences Aargau, Switzerland

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




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

* Using C dll from Ada95
@ 2000-01-11  0:00 Philipp Boeni
  2000-01-11  0:00 ` Tucker Taft
  0 siblings, 1 reply; 2+ messages in thread
From: Philipp Boeni @ 2000-01-11  0:00 UTC (permalink / raw)


Hello everybody!
I want to use a C-dll (created with Visual Studio 6) in Ada95 (Aonix IDE
7.1.2). Ada-Target: Command-Line App (Win32). The DLL uses the following
function exportation: #define DLLExport extern "C" __cdecl (dllexport) and
is NOT using any MFC enhancements...
So what exactly do I need from the dll to build the Ada-project? If I use
the "myDll.lib"-file (added to the Ada link-path), I receive a Link
1006-error (error seeking file, could not reach address...) and if I do not
use the lib-file, the linker complains about an undefined external symbol
(the exported function name, that a want to call from Ada)...

Thanks for any help....

Philipp Boeni, University of Applied Sciences Aargau, Switzerland






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

end of thread, other threads:[~2000-01-11  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-11  0:00 Using C dll from Ada95 Philipp Boeni
2000-01-11  0:00 ` Tucker Taft

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