<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-outline-level: 1; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Problem summary</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Trying to build a stand-alone executable GLUT app with ghc, Windows XP <br style="mso-special-character: line-break">
<br style="mso-special-character: line-break"></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-outline-level: 1; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Problem description</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I compile and link (without errors) a simple GLUT application under Windows XP. <br>
When I run it, XP pops an error window saying the app cannot start due to a missing &quot;glut32.dll&quot;. <br><span style="mso-spacerun: yes">&nbsp;</span><br>I want to do a static build to create a stand-alone executable GLUT app under Windows XP, <br>
without using DLL files, or placing any files in the Windows system dir. <br>This is my first GUI code in Haskell, and I chose GLUT because it is a standard library. <br><span style="mso-spacerun: yes">&nbsp;</span><br>Following are some details. <br>
Thanks much for any advice. <br style="mso-special-character: line-break"><br style="mso-special-character: line-break"></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-outline-level: 1; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Source code</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">-- Simple GLUT app to create a window <br>module Main(main) where <br>
<span style="mso-spacerun: yes">&nbsp;</span><br>import Graphics.Rendering.OpenGL <br>import Graphics.UI.GLUT <br><span style="mso-spacerun: yes">&nbsp;</span><br>main = do<span style="mso-spacerun: yes">&nbsp; </span><br><span style="mso-spacerun: yes">&nbsp;</span><span style="mso-spacerun: yes">&nbsp; </span>(progname, _) &lt;- getArgsAndInitialize <br>
<span style="mso-spacerun: yes">&nbsp;&nbsp; </span>createWindow &quot;Hello World&quot; <br><span style="mso-spacerun: yes">&nbsp;&nbsp; </span>mainLoop <br style="mso-special-character: line-break"><br style="mso-special-character: line-break">
</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-outline-level: 1; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Compile/run Environment</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">ghc-6.8.2 on a USB flashdrive under a non-admin Windows XP account</span></p>

<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">ghc dir is not on C:</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 35pt; mso-outline-level: 3; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">E:\apps\ghc\ghc-6.8.2</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">XP shell used: cmd.exe</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-outline-level: 1; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">shell path</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">E:\ghcTest&gt;path</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">PATH=C:\WINDOWS\system32;C:\WINDOWS;E:\apps\ghc\ghc-6.8.2\bin;.\</span></p>

<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-outline-level: 1; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">ghc library path</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">E:\ghcTest&gt;ghc --print-libdir</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">E:/apps/ghc/ghc-6.8.2</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-outline-level: 1; mso-layout-grid-align: none"><span style="FONT-SIZE: 10.5pt; FONT-FAMILY: Arial">compile/link output</span><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></span></p>

<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">E:\ghcTest&gt;ghc --make x<span style="mso-spacerun: yes">&nbsp; </span>-package GLUT</span></p>

<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">[1 of 1] Compiling Main<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>( x.hs, x.o )</span></p>

<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Linking x.exe ...</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">E:\ghcTest&gt;</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-outline-level: 1; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">files (sizes in bytes)</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>186 x.hs <br><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>387 x.hi <br>
<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>3,184 x.o <br><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>498 x.exe.manifest <br>609,222 x.exe <br style="mso-special-character: line-break"><br style="mso-special-character: line-break">
</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-outline-level: 1; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">When application is run</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Error dialog window pops up</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 35pt; mso-outline-level: 3; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">window title</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 52.5pt; mso-outline-level: 4; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">a.exe - Unable To Locate Component</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 35pt; mso-outline-level: 3; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">window text</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 52.5pt; mso-outline-level: 4; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The application has failed to start because glut32.dll was not found.<span style="mso-spacerun: yes">&nbsp; </span><br>
Re-installing the application may fix this problem. <br style="mso-special-character: line-break"><br style="mso-special-character: line-break"></span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">No output in shell; no glut window is created.</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-outline-level: 1; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-outline-level: 1; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Other builds tried; same runtime error</span></p>
<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">ghc<span style="mso-spacerun: yes">&nbsp; </span>--make x<span style="mso-spacerun: yes">&nbsp; </span>-package GLUT<span style="mso-spacerun: yes">&nbsp; </span>-static</span></p>

<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">ghc -package GLUT<span style="mso-spacerun: yes">&nbsp; </span>x.hs<span style="mso-spacerun: yes">&nbsp; </span>-o x</span></p>

<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">ghc --make x<span style="mso-spacerun: yes">&nbsp; </span>-package GLUT<span style="mso-spacerun: yes">&nbsp; </span>-LE:\apps\ghc\ghc-6.8.2\lib\GLUT-2.1.1.1</span></p>

<p class="MsoNormal" style="MARGIN: 0in 0in 0pt 17.5pt; mso-outline-level: 2; mso-layout-grid-align: none"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">ghc --make x<span style="mso-spacerun: yes">&nbsp; </span>-LE:\apps\ghc\ghc-6.8.2\lib\GLUT-2.1.1.1</span></p>

<div class="MsoNormal" style="MARGIN: 0in 0in 0pt"><font face="Times New Roman">&nbsp;</font></div>
<div class="MsoNormal" style="MARGIN: 0in 0in 0pt"><font face="Times New Roman">--</font></div>
<div class="MsoNormal" style="MARGIN: 0in 0in 0pt"><font face="Times New Roman"></font>&nbsp;</div>