The most common compile error message is a "Bad Command or Filename" in response to the CL command (or gcc not installed on the Macintosh). Usually this means that you have not set up paths to the C compiler correctly. See the discussion of the compile batch file below for more details.
Sometimes, however, you will get other error messages and the easiest way to track these down is with this set of steps:
| 1. | Save your model in binary form in the same directory you have installed the compiled simulation files (normally this is c:\Documents and Settings\All Users\Vensim\comp (Windows XP), c:\Users\Public\Vensim\comp (Windows Vista/7) or /Users/Shared/Vensim/comp (Macintosh)). You do not need to copy any supporting datasets or other files. |
| 2. | Attempt to compile and simulate this model. |
If step 2 succeeds there is something very funny going on, and the following steps may not be of much help. If it fails, as is to be expected, continue working through these steps.
| 3. | Read compile_out.txt in the model's directory. The batch file redirects everything the compiler and linker say to that file, and prints it to the console window when the build fails. A duplicate symbol report runs to hundreds of lines, which is why it goes to a file rather than to a window that closes. |
| 4. | If a message names a file and a line, open it. mdl.h and the mdl_000.c, mdl_001.c ... files Vensim generated are plain C, and the line named is usually the equation that produced the problem. |
If there are errors in the generated C that prevent compilation it is not worthwhile to correct them. The mdl.h and mdl_NNN.c files are generated automatically by Vensim, and either the code it is putting out is bad, or something has happened to simext.c (which they include) or vensim.h to render the statements wrong. Those two files have to come from the same Vensim release as the batch file; an older copy of either will produce duplicate or static definition errors. If you did not change either of them please contact us.