Compiling newmat11 under DEV-C++

DEV-C++ is a free development environment for MS Windows based around the Gnu C++ compiler. Download it from http:www.bloodshed.net/devcpp.html (what a horrible name).

Here are my instructions for compiling newmat11 under DEV-C++ using the IDE for producing a program to run in console mode (i.e. from an MSDOS window). The same instructions should work for my other C++ programs.

  1. Copy your source files and all the newmat files to the same directory. You can use the version of the Newmat files from newmat11.zip.
  2. Start the DEV-C++ IDE
  3. Click the IDE select menu file / new / project to bring up the new project window
  4. Click console application and C++ project
  5. Fill in the name with your project name - I am calling my one example - click OK
  6. A dummy main program should appear - you can start building on this - I don't want to do this.
  7. Delete the dummy main program by left clicking the name main.cpp in the left hand window, then click remove file on the drop down menu.
  8. Goto menu item project /  add to project
  9. This brings up a window showing all the files in the directory where you stored the newmat files. If not, change to this directory.
  10. Hold down the control key and click your main program (in my case example.cpp) and all the newmat files (ie all the .h files and .cpp files in newmat except the tmt files, nl_ex.cpp, sl_ex.cpp, garch.cpp and test_exc.cpp) and click open.
  11. Click menu item execute / compile.
  12. In my case there were no error messages. If there is a link error it is probably because you have not included one of the .cpp files or you have included an extra main program file (such as tmt.cpp).
  13. Click menu item execute / run. Program will run but since I don't have a pause at the end of the program the output will vanish as soon as the program has run.
  14. Open an MSDOS window and use CD to change the directory to the one where you stored everything.
  15. Type you program name (example in my case) followed by | more. Press the space key to advance through the output pages
  16. If you are compiling my program, example, you can compare the output with example.txt to check that you get the same output.