Installing Compiler in Vensim

Use this forum to post Vensim related questions.
Post Reply
Johnpastor
Newbie
Posts: 1
Joined: Wed Sep 19, 2018 2:02 am
Vensim version: DSS

Installing Compiler in Vensim

Post 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
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Installing Compiler in Vensim

Post by Administrator »

Visual Basic will be of no use, you need a C/C++ compiler.

https://visualstudio.microsoft.com/vs/community/
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: Installing Compiler in Vensim

Post by tomfid »

Also, I'd recommend updating to version 7.3, which has an improved mdl.bat.
Post Reply