Note: these are just instructions on how to get the BUILD ENVIRONMENT setup correctly.

Sorry it's not formatted terribly nice.


  1. Download the following files (they're in the "Protected Mode" section of the resources page) and save them somewhere on disk (that you can find later =):
  2. Unzip ex291.zip to somewhere. (Mine is in D:\Users\jkq\ECE291\ex291.)
  3. Unzip pmodelib.zip to somewhere. (Mine is in D:\Users\jkq\ECE291\pmodelib.)
  4. Unzip djgpp.zip to somewhere. This one's big, so it may take a few minutes. (Mine is in D:\Users\jkq\djgpp.)
  5. From here on out, you probably want to replace MY paths with your paths. So, if your ex291 lives in C:\ex291, then replace D:\Users\jkq\ECE291\ex291\bin with C:\ex291\bin, and so on.

  6. Now to fiddle with the paths.
    1. Right click on "My Computer" and left click on the "Properties" entry in the popup menu.
    2. Goto the "Advanced" tab, and click the "Environment Variables" button.
    3. In the "User variables" section, look for a variable named "PATH" (or "Path", etc.). If the variable exists, continue, otherwise goto step 6.
    4. Highlight the entry for "PATH", then click the "Edit" button.
    5. In the window that pops up, add the following string *AFTER* the stuff in the "Variable value:" field (w/o the quotes):
    6.    ";D:\Users\jkq\djgpp\bin;D:\Users\jkq\ECE291\ex291\bin"

      So, my "Variable value:" used to be this (w/o the quotes):

         "%HOMEDRIVE%%HOMEPATH%\bin"

      and after 5.5, it's this (again, w/o the quotes):

         "%HOMEDRIVE%%HOMEPATH%\bin;D:\Users\jkq\djgpp\bin;D:\Users\jkq\ECE291\ex291\bin"

  7. Okay, if you *DIDN'T* have the "PATH" variable (see step 5.3), continue on to step 6.1, otherwise goto step 7.
    1. Click the "New" button, and in the new window, fill in the values like so:
    2. Variable name:PATH
      Variable value:D:\Users\jkq\djgpp\bin;D:\Users\jkq\ECE291\ex291\bin
    3. Click the "OK" button.
  8. Time to fill in the other required environment variables:
    1. Click the "New" button, and in the new window, fill in the values like so:
    2. Variable name:DJGPP
      Variable value:D:\Users\jkq\djgpp\djgpp.env
    3. Click the "New" button, and in the new window, fill in the values like so:
    4. Variable name:EX291
      Variable value:w_K7,300_M12
      Note that the spaces in the value field have been replaced w/ the underscore "_" character
    5. Click the "New" button, and in the new window, fill in the values like so:
    6. Variable name:VBEAF_PATH
      Variable value:D:\Users\jkq\ECE291\ex291\bin
      Note the underscore in the name field -- it really IS an underscore!
  9. Now the all-important step: making sure mp4 can compile. =)
    1. Edit the Makefile w/ vim (err... your favorite editor), and replace any occurance of "v:/ece291/pmodelib" with your pmodelib install dir. There should be two of them, one starting with "gcc" and the other starting with "nasm". (So mine is "d:/users/jkq/ece291/pmodelib". Remember, case does not matter with Windows and DOS).
    2. Make sure that those two lines start with a tab, not spaces. If your editor doesn't know what a tab is, use vim (or notepad).
    3. So, this line:

         gcc -o mp4 mp4.o v:/ece291/pmodelib/lib291.a libmp4.a

      becomes this line:

         gcc -o mp4 mp4.o d:/users/jkq/ece291/pmodelib/lib291.a libmp4.a

      And this line:

         nasm -f coff -iv:/ece291/pmodelib/include/ -o $ $*.o $< -l $*.lst

      becomes this line:

         nasm -f coff -id:/users/jkq/ece291/pmodelib/include/ -o $ $*.o $< -l $*.lst

  10. Finally, open a new dos box (don't use any that you may have opened already, as the environment settings probably won't have been added there), change to the directory where you put mp4, and do "make" as usual. If all goes well, it'll chug away for a while, and you'll have a mp4.exe to play with.