Hi,<br><br>Thanks for very quick reply Claude. Your suggestion resolved the issue. Using extern &quot;C&quot; worked for me.<br><br>Thank you very much.<br><br>Thanks to all.<br><br>Regards,<br>Rajendra<br><br><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote"><div class="im">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Claude Heiland-Allen</b> <span dir="ltr">&lt;<a href="mailto:claude@goto10.org" target="_blank">claude@goto10.org</a>&gt;</span><br>


Date: Wed, Mar 14, 2012 at 7:43 PM<br>Subject: Re: [Haskell-cafe] Unable to call function from DLL using FFI<br>To: <a href="mailto:haskell-cafe@haskell.org" target="_blank">haskell-cafe@haskell.org</a><br><br><br></div>

<div class="im"><div>On 14/03/12 14:01, rajendra prasad wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
My c++ code(HelloWorld.cpp) looks like this:<br>
</blockquote>
<br></div></div>
Try adding extern &quot;C&quot; { ... } 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).<div class="im">

<div>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
__declspec(dllexport) int doubleMe(int a)<br>
{<br>
     return 2*a;<br>
}<br>
</blockquote>
<br>
<br></div></div>
Claude<br>
<br>
______________________________<u></u>_________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/<u></u>mailman/listinfo/haskell-cafe</a><br>
</div><br>
</blockquote></div><br>