aboutsummaryrefslogtreecommitdiff
path: root/index.html
blob: dd9d61f6cda1ba8b279d4659007cf1ec9f0d9eb6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<h1>run</h1>
<p><i>run</i> is a C interpreter for Windows -- or more accurately, it
is a compiler and cacher of C programs. When given the file <i>example.c</i>,
<i>run</i> compiles and executes it. The resulting executable, <i>example.exe</i>,
is stored in the same directory, but as a hidden file. Now, any
subsequent time <i>example.c</i> is run, it is re-compiled only if it
has been modified since the last compilation.<br>
</p>
<h2>Installation</h2>
<p>First of all, make sure you have all the <a href="#prerequisites">prerequisites</a>
in place. Put <i>run.exe</i> and <i>rungui.exe</i> somewhere in your
PATH. To run C files from the command prompt, issue the following
command:</p>
<pre>C:\&gt; run filename.c [arguments ...]<br></pre>
<p>To run C files from Explorer, set <i>rungui.exe</i> as the default
program for <i>.c</i> files, or use the <i>Open With</i> menu to
select <i>rungui.exe</i>.<br>
</p>
<h2 id="prerequisites">Prerequisites</h2>
<p><i>run</i> does not include a C compiler nor any standard library.
You must install these manually and add their paths to the relevant
environment libraries:<br>
</p>
<ul>
  <li>(Required) C compiler and linker named <i>cl</i> placed
somewhere in your PATH</li>
  <li>(Optional) C header files placed somewhere in INCLUDE</li>
  <li>(Optional) C libraries placed somewhere in LIB</li>
</ul>
<p>If you wish to use <i>run</i> with Visual Studio (C++) and/or the
Windows SDK, you can define the VSDIR and/or SDKDIR environment
variables, and <i>run</i> will automatically set INCLUDE, LIB and PATH
to the correct values:<br>
</p>
<table border="1" cellpadding="2" cellspacing="2">
  <tbody>
    <tr>
      <td valign="top"><b>If you define...<br>
      </b></td>
      <td valign="top"><b>Then <i>run</i> will set...<br>
      </b></td>
    </tr>
    <tr>
      <td valign="top">
      <pre style="margin: 0pt;">VSDIR</pre>
      </td>
      <td valign="top">
      <pre style="margin: 0pt;">INCLUDE = VSDIR\vc\include<br>LIB     = VSDIR\vc\lib<br>PATH    = VSDIR\vc\bin;<br>          VSDIR\Common7\IDE</pre>
      </td>
    </tr>
    <tr>
      <td valign="top">
      <pre style="margin: 0pt;">SDKDIR<br></pre>
      </td>
      <td valign="top">
      <pre style="margin: 0pt;">INCLUDE = SDKDIR\include<br>LIB     = SDKDIR\lib</pre>
      </td>
    </tr>
  </tbody>
</table>
<h3>Tips</h3>
<ol style="margin-left: 0pt; padding-left: 1em;">
  <li style="margin: 1em; padding: 1em; background-color: rgb(232, 244, 255);">To
create or modify an environment variable, run <i>sysdm.cpl</i> (or
right-click on My Computer), select the <i>Advanced</i> tab and click
on <i>Environment Variables</i>.<br>
  </li>
  <li style="margin: 1em; padding: 1em; background-color: rgb(229, 255, 233);">Visual
C++ Express Edition and the Windows SDK are both freely available for
download online. I personally use <a href="https://filehippo.com/download_visualc_2010_express_edition/">Visual
C++ 2010</a> and the <a href="https://www.microsoft.com/en-us/download/details.aspx?id=12261">Windows
Server 2003 SP1 Platform SDK</a>.</li>
  <li style="margin: 1em; padding: 1em; background-color: rgb(253, 255, 215);">To
use a non-Microsoft compiler with <i>run</i>, such as <i>gcc</i>,
just make a copy of it named <i>cl.exe</i> and put its location in
your PATH variable.<br>
  </li>
</ol>