Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Other answer has the simple command to compile this, but here's a very rough and simple Makefile example, to get you started down that road. Create a file named <code>Makefile</code> with these contents, where <code>&lt;tab&gt;</code> must be an actual tab character, not some number of spaces:</p> <pre><code>Craps.exe : Craps.o random.o &lt;tab&gt;g++ -o $@ $^ Craps.o random.o : random.h </code></pre> <p>Then just run</p> <pre><code>make Craps.exe </code></pre> <p>(possibly <code>gmake</code> or <code>mingw32-make</code> instead of plain <code>make</code>).</p> <p>Now Make has some magic built in about file types, so when it sees <code>Craps.exe</code> needs those two <code>.o</code> files, it'll start looking for files it could make them from, and it finds .cpp files, and knows how to compile them into .o files. Now it doesn't implicitly know how make <code>.exe</code> out of <code>.o</code> files, so that's why we have the 2nd line. There <code>$@</code> means the target of the rule (<code>Craps.exe</code> here), while <code>$^</code> means all the files listed after the <code>:</code>.</p> <p>The <code>Craps.o random.o:random.h</code> rule means, that if random.h is changed, Craps.o and random.o needs to be re-created again (these .h file dependencies can be generated automatically, but as long as you have just a few files, writing them by hand is ok).</p> <p>If you need to add more source files, just add them with the .o suffix to the first line, and make will include them in the compilation. Also note how make will only compile changed files... Then you will need to add .h file dependencies when you get more .h files.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload