[Haskell-cafe] Unable to call function from DLL using FFI

rajendra prasad rajendradprasad at gmail.com
Thu Mar 15 07:54:21 CET 2012


Hi,

Thanks for very quick reply Claude. Your suggestion resolved the issue.
Using extern "C" worked for me.

Thank you very much.

Thanks to all.

Regards,
Rajendra


>
> ---------- Forwarded message ----------
> From: Claude Heiland-Allen <claude at goto10.org>
> Date: Wed, Mar 14, 2012 at 7:43 PM
> Subject: Re: [Haskell-cafe] Unable to call function from DLL using FFI
> To: haskell-cafe at haskell.org
>
>
> On 14/03/12 14:01, rajendra prasad wrote:
>
>> My c++ code(HelloWorld.cpp) looks like this:
>>
>
> Try adding extern "C" { ... } to use the C ABI instead of a C++ ABI (which
> usually features symbol name mangling to add type information, among other
> things).  (This may not solve the entire problem, but is an important
> puzzle-piece).
>
>
>  __declspec(dllexport) int doubleMe(int a)
>> {
>>     return 2*a;
>> }
>>
>
>
> Claude
>
> ______________________________**_________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/**mailman/listinfo/haskell-cafe<http://www.haskell.org/mailman/listinfo/haskell-cafe>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120315/388e4a53/attachment.htm>


More information about the Haskell-Cafe mailing list