problems with the ffi
David Abbs
u0da2@dcs.shef.ac.uk
Sun, 10 Nov 2002 19:53:34 -0000
This is a multi-part message in MIME format.
------=_NextPart_000_0002_01C288F2.DB077F40
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
I am having problems with the ghc ffi, I have compiled the Haskell
source on the ffi example page to create the stub file and the c file,
the only problem now is that I can't compile the sample c code. I assume
that if you place the c code and all the files in the ghc include
directory that it should compile. However I am getting errors, to begin
I get something like can't find stint.h when it is definitely present.
Then I get errors with the special Haskell ffi procedures i.e.
startupHaskell(argc, argv, __stginit_Foo). The compiler says that this
is an unresolved external symbol.
I am attempting this on windows xp using visual c++ 5. Any help would be
greatly appreciated.
____________________________________________________
David Abbs 3rd Year Computer Science University Of Sheffield
u0da2@dcs.shef.ac.uk
____________________________________________________
------=_NextPart_000_0002_01C288F2.DB077F40
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:st1=3D"urn:schemas-microsoft-com:office:smarttags" =
xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DProgId content=3DWord.Document>
<meta name=3DGenerator content=3D"Microsoft Word 10">
<meta name=3DOriginator content=3D"Microsoft Word 10">
<link rel=3DFile-List href=3D"cid:filelist.xml@01C288F2.D9FEE8E0">
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"PlaceType"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"PlaceName"/>
<o:SmartTagType =
namespaceuri=3D"urn:schemas-microsoft-com:office:smarttags"
name=3D"place"/>
<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:DoNotRelyOnCSS/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:SpellingState>Clean</w:SpellingState>
<w:GrammarState>Clean</w:GrammarState>
<w:DocumentKind>DocumentEmail</w:DocumentKind>
<w:EnvelopeVis/>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]--><!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;
text-underline:single;}
span.EmailStyle17
{mso-style-type:personal-compose;
mso-style-noshow:yes;
mso-ansi-font-size:10.0pt;
mso-bidi-font-size:10.0pt;
font-family:Arial;
mso-ascii-font-family:Arial;
mso-hansi-font-family:Arial;
mso-bidi-font-family:Arial;
color:windowtext;}
span.SpellE
{mso-style-name:"";
mso-spl-e:yes;}
span.GramE
{mso-style-name:"";
mso-gram-e:yes;}
@page Section1
{size:595.3pt 841.9pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;
mso-header-margin:35.4pt;
mso-footer-margin:35.4pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */=20
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";}
</style>
<![endif]-->
</head>
<body lang=3DEN-GB link=3Dblue vlink=3Dpurple =
style=3D'tab-interval:36.0pt'>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I am having problems with the ghc ffi, I have =
compiled the Haskell
source on the ffi example page to create the stub file and the c file, =
the only
problem now is that I can’t compile the sample c code. I assume =
that if
you place the c code and all the files in the ghc include directory that =
it
should compile. However I am getting errors, to begin <span =
class=3DGramE>I</span>
get something like can’t find <span class=3DSpellE>stint.h</span> =
when it
is definitely present. Then I get errors with the special Haskell ffi
procedures i.e. <span class=3DSpellE><span =
class=3DGramE>startupHaskell</span></span><span
class=3DGramE>(</span><span class=3DSpellE>argc</span>, <span =
class=3DSpellE>argv</span>,
__<span class=3DSpellE>stginit_Foo</span>). The compiler says that this =
is an
unresolved external symbol.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I am attempting this on windows <span =
class=3DSpellE>xp</span>
using visual c++ 5. Any help would be greatly =
appreciated.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>____________________________________________________<o=
:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>David <span class=3DSpellE>Abbs</span> 3<sup>rd</sup> =
</span></font><st1:place><st1:PlaceName><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Year</span></font></st1:Plac=
eName><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> =
</span></font><st1:PlaceName><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Computer</span></font></st1:=
PlaceName><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> =
</span></font><st1:PlaceName><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Science</span></font></st1:P=
laceName><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> =
</span></font><st1:PlaceType><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>University</span></font></st=
1:PlaceType></st1:place><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'> <span
class=3DGramE>Of</span> </span></font><st1:place><font size=3D2 =
face=3DArial><span
=
style=3D'font-size:10.0pt;font-family:Arial'>Sheffield</span></font></st1=
:place><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'><o:p></o:p></span></font></p=
>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><a =
href=3D"mailto:u0da2@dcs.shef.ac.uk">u0da2@dcs.shef.ac.uk</a>
<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>____________________________________________________<o=
:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
</div>
</body>
</html>
------=_NextPart_000_0002_01C288F2.DB077F40--