Page 1 of 1

Installing Compiler in Vensim

Posted: Thu Sep 20, 2018 12:26 am
by Johnpastor
Hello, I'm having problems installing compiler in my Vensim DSS. this is the message i get when I run the model:

['CL' is not recognized as an internal or external command. operable program or batch file. there were errors while compiling -check the paths in mdl.bat in Vensim\comp Press any key to continue.]

I installed it using VISUAL BASIC 2017 (COMMUNITY). I am not sure if this is the reason it is not working. I have installed it before using C++ (if i have not forgotten) and it worked very well. looking forward to hearing from you soon. My path to mdl.bat is [C:\Users\Public\Vensim\COMP]

below is the edited mdl.bat file.

@ECHO OFF
call "C:\Program Files (x64)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"
if exist mdl.obj del mdl.obj
if exist %3.dll del %3.dll
if .%2 == . goto noinclude
CL /O2 /c /I "%2" /DWIN32 mdl.c
goto aftercomp
:noinclude
CL /O2 /c /DWIN32 mdl.c
:aftercomp
if errorlevel 1 goto :error1
if not exist mdl.obj goto :error2
LINK /DLL /OUT:%3.dll /def:%1sim.def mdl.obj
if errorlevel 1 goto :error3
if not exist %3.dll goto :error3
REM clean up .lib and .exp files - they are not neaded
del %3.lib
del %3.exp
goto :exit
:error1
echo There were errors while compiling - check the paths in mdl.bat in vensim\comp
goto exit2
:error2
echo Unable to compile. You probably need to set paths in mdl.bat in vensim\comp
goto exit2
:error3
echo Errors while linking %3.dll - make sure compiled simulations were properly installed
goto :exit2
:exit2
pause
goto :exit3
:exit
echo ----------
echo Compilation of %3 seems to have been successful.
echo Close this window and continue.
:exit3

regards
john

Re: Installing Compiler in Vensim

Posted: Thu Sep 20, 2018 10:21 am
by Administrator
Visual Basic will be of no use, you need a C/C++ compiler.

https://visualstudio.microsoft.com/vs/community/

Re: Installing Compiler in Vensim

Posted: Thu Sep 20, 2018 2:25 pm
by tomfid
Also, I'd recommend updating to version 7.3, which has an improved mdl.bat.