Problem creating bindings - please help
- From: "Gerd" <GerdM.O@xxxxxxxxxxx>
- Date: 17 May 2006 23:46:23 -0700
Hi all,
I tried to create my own Ada bindings for a dll, but I didn't succeed.
The C-header contains:
DWORD __stdcall CAN_GetHwParam(
HCANHW hHw,
WORD wParam,
void* pBuff,
WORD wBuffLen);
My Ada-spec look like this:
with System;
package CanApi2 is
pragma Linker_Options ("-lCanApi2");
subtype
HCANHW is Integer;
subtype
Word is Integer;
function CAN_GetHwParam (hHw : HCANHW; wParam : Word; pBuff :
System.Address; wBuffLen : Word) return Integer;
private
pragma Import (Stdcall, CAN_GetHwParam, External_Name =>
"CAN_GetHwParam");
end CanApi2;
The lib-file (CanApi2.lib) contains this names:
_CAN_GetHwParam@16 __imp__CAN_GetHwParam@16 _CAN_SetHwParam@12
__imp__CAN_SetHwParam@12
And that's what I get when build my test-program:
C:\Work\CAN>gnatmake cantest
gcc -c cantest.adb
gcc -c canapi2.ads
gnatbind -x cantest.ali
gnatlink cantest.ali
../cantest.o(.text+0x264):cantest.adb: undefined reference to
`CAN_GetHwParam@16'
gnatlink: cannot call C:\GNAT\bin\gcc.exe
gnatmake: *** link failed.
DLL2DEF shows this:
EXPORTS
CAN_GetHwParam
So what's wrong with my code? Please help, thanks.
Gerd
.
- Follow-Ups:
- Re: Problem creating bindings - please help
- From: Steve
- Re: Problem creating bindings - please help
- From: Dmitry A. Kazakov
- Re: Problem creating bindings - please help
- Prev by Date: Re: Multi-arch
- Next by Date: Re: Problem creating bindings - please help
- Previous by thread: Multi-arch
- Next by thread: Re: Problem creating bindings - please help
- Index(es):