I'm trying to compile a model from Vensim 5.9. The compiler I'm using is Visual C# Express 2008 Edition.
After editing MDL.BAT to reset the path statements etc to c:\program files\Microsoft Visual Studio 9.0\....
and recompiling the Simext.c ,when i get to the step to compile the actual model I get many error messages, such as:
syntax error identifier 'comp_rate'
syntax error identifier 'init_time'
etc
Guess I've missed out definitions or linking somewhere along the route (I'm totally clueless when it comes to programming) . Anybody had anything similar or can point me to where I may have gone wrong ?
Compiling model
-
- Super Administrator
- Posts: 4838
- Joined: Wed Mar 05, 2003 3:10 am
Try editing the mdl.bat file and adding the following line right at the top of the file.
call "C:\Program Files\Microsoft Visual Studio 9\VC\bin\vcvars32.bat"
Just make sure the path to vcvars32.bat is correct.
Also check in Vensim that it is calling the correct MDL.BAT (Tools->Options->Startup, compiled simulation path).
Tony.
call "C:\Program Files\Microsoft Visual Studio 9\VC\bin\vcvars32.bat"
Just make sure the path to vcvars32.bat is correct.
Also check in Vensim that it is calling the correct MDL.BAT (Tools->Options->Startup, compiled simulation path).
Tony.
Thanks Tony, tried that but still no joy.
The VCVars command files runs ok, Simext.c compiles okay, and the startup path is correct.
The first line it falls over on in mdl.c is:
void VEFCC comp_rate(void)
{
mdl_func0();
}
With my minute amount of C programming knowledge, could it be anything to do with the version of simext.c I'm using, as I notice this has the line
void PASCAL ccomp_rate() {comp_rate() ;}
if squiggly brackets means comment out
Maybe I'm using the wrong simext.c ?
The VCVars command files runs ok, Simext.c compiles okay, and the startup path is correct.
The first line it falls over on in mdl.c is:
void VEFCC comp_rate(void)
{
mdl_func0();
}
With my minute amount of C programming knowledge, could it be anything to do with the version of simext.c I'm using, as I notice this has the line
void PASCAL ccomp_rate() {comp_rate() ;}
if squiggly brackets means comment out
Maybe I'm using the wrong simext.c ?
-
- Super Administrator
- Posts: 4838
- Joined: Wed Mar 05, 2003 3:10 am
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
Note that the file simext.c is no longer compiled separately, rather it is simply included in mdl.c. Generally you should not have to do much beyond change the path statements in mdl.bat after it is installed. It is probably better to reinstall compiled simulation support and edit mdl.bat than to try to adapt an existing comp directory. vcvars32 sometimes works, but sometimes overruns the environmental memory buffers and leaves you with partial paths to things - though that may be an old memory (win NT/2K and not XP/Vista).