Error in compilation

Use this forum to post Vensim related questions.
Post Reply
Christian.Chaboud
Junior Member
Posts: 7
Joined: Wed May 04, 2011 11:52 am

Error in compilation

Post by Christian.Chaboud »

Dear colleage

I have just received a new Vension Vensin DSS version (5.11).
My OS is Windows 7 64 bites.

When trying to compile a Vensim program I obtain the error message :

**************************
Setting environment for using Microsoft Visual Studio 2008 x86 tools.
Compilateur d'optimisation Microsoft (R) 32 bits C/C++ version 15.00.30729.01 po
ur 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

mdl.c
mdl.c(2) : fatal error C1083: Impossible d'ouvrir le fichier include : 'simext.c
' : No such file or directory
There were errors while compiling - check the paths in mdl.bat in vensim\comp
Appuyez sur une touche pour continuer...

*****************************

I use the following mdl.bat :

*******************************
@ECHO OFF
call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"
if exist mdl.obj del mdl.obj
if exist sim.dll del sim.dll
if exist simdll32.dll del simdll32.dll
if exist simdlx32.dll del simdlx32.dll
CL /O2 /c /DWIN32 mdl.c
if errorlevel 1 goto :error1
if not exist mdl.obj goto :error2

LINK /DLL /OUT:sim.dll /NODEFAULTLIB:libc.lib /def:%1sim.def mdl.obj %1simext.obj %1vensim.lib
if errorlevel 1 goto :error3
if not exist sim.dll goto :error3

del sim.lib
del sim.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 sim.dll - make sure compiled simulations were properly installed
goto :exit2
:error4
echo Errors linking for use with the full dll - check that ..\dll is the right directory
goto :exit2
:error5
echo Errors linkinf for use with the redistribution DLL - check that ..\dll is the right directory
goto :exit2
:exit2
pause
goto :exit3
:exit
echo ----------
echo Compilation of sim.dll seems to have been successful.
echo Close this window and continue.
:exit3

**************************************************************************

Thanks for your help

Regards
Administrator
Super Administrator
Posts: 4847
Joined: Wed Mar 05, 2003 3:10 am

Re: Error in compilation

Post by Administrator »

This usually happens when you use the compilation files from an old version of Vensim (eg, Vensim 5.8) with a newer version of Vensim.

Do you have more than one version of Vensim installed on your computer?
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: 4003
Joined: Wed May 24, 2006 4:54 am

Re: Error in compilation

Post by tomfid »

You should be pointed to the mdl.bat in your latest Vensim install directory - which should be c:\users\public\Vensim. Note that you may have to edit the .bat to point to the correct compiler. Currently the mdl.bat installed with Vensim 5.11 points to Visual Studio 2010 (which will work with the free Express version). mdldp.bat (double precision) has not been updated, so you may need to modify it - normally that's just a matter of adjusting the REM statements to activate the correct version, unless your compiler install is nonstandard.

Tom
Post Reply