MS C/C++ DLLs for Vensim DSS models

Use this forum to post Vensim related questions.
Post Reply
Dr John P Weldon
Member
Posts: 39
Joined: Sun Oct 07, 2018 7:56 pm
Vensim version: DSS

MS C/C++ DLLs for Vensim DSS models

Post by Dr John P Weldon »

I am using Vensim DSS v8.1.0 with Visual Studio 2017 in Windows 10. Do I still have the option of writing subprograms in MS C? Or, must they be written in C++?

When I double-click on the Vensim icon on the desktop I get a message (before any model is loaded):

External function version mismatch need 62051 got 52050.

Subprograms compile into a DLL. Is the above message explained by using MS C instead of MS C++?
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: MS C/C++ DLLs for Vensim DSS models

Post by tomfid »

The issue here is that v8+ changed the external function library headers somewhat, so things need to be recompiled. You can still use C, and most simple code won't need to change.
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: MS C/C++ DLLs for Vensim DSS models

Post by Administrator »

Dr John P Weldon wrote: Sat Aug 01, 2020 6:42 am I am using Vensim DSS v8.1.0 with Visual Studio 2017 in Windows 10. Do I still have the option of writing subprograms in MS C? Or, must they be written in C++?

When I double-click on the Vensim icon on the desktop I get a message (before any model is loaded):

External function version mismatch need 62051 got 52050.

Subprograms compile into a DLL. Is the above message explained by using MS C instead of MS C++?
Earlier in the year I recompiled the DLL for you so it worked with the latest version of Vensim. You need to use this rather than older versions.
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: 3806
Joined: Wed May 24, 2006 4:54 am

Re: MS C/C++ DLLs for Vensim DSS models

Post by tomfid »

That would be a matter of setting the path in Tools>Options>Startup.
Dr John P Weldon
Member
Posts: 39
Joined: Sun Oct 07, 2018 7:56 pm
Vensim version: DSS

Re: MS C/C++ DLLs for Vensim DSS models

Post by Dr John P Weldon »

When you earlier recompiled the DLL for me I was using Visual Studio 2008 and DSS version 7.2. Now I am using VS 2017 and DSS v8.1.0.

After implementing advice in the past 24 hours from Administrator Tomfid, I have advanced to 'External function version mismatch need version 62051 (got 62050)' for one model.

But, I also get 'Memory allocation failure - subblock' on the same model. After that the model will not load.

A second model that uses the same DLL as the one above does load. However, when I click on 'check model' I get 'Syntax error'. This model does not recognise its DLL, which is correctly addressed for the model.

A third model that uses the same DLL will not load. It gives 'Memory allocation failure - subblock'. A fourth model that uses the same DLL does load, but returns 'Syntax error'.

Another model (independent of the above four models) returns 'External function version mismatch need version 62051 (got 52050)' and 'Syntax error'. This model received the same changes as the above four models.

Two further models use the same DLL as each other. Both return 'Memory allocation failure - subblock' and will not load.

An additional six models (each with its own compiled DLL) also return 'Memory allocation failure - subblock'.

Points to emphasise are:

* these thirteen models load, compile and run under DSS v6.3, VS 2008 and Windows XP;
* paths are set Tools/Options/Startup;
* the DLLs have been stable, with almost no changes in the C subprograms, since DSS v6.3;
* it is DSS that has changed, and one or more of those changes is giving me a hard time;
* updating vensim.h has not been enough.

Can you suggest additional steps to resolve this situation?
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: MS C/C++ DLLs for Vensim DSS models

Post by tomfid »

Unfortunately, now that Apple and MS have adopted a steady drumbeat of forced updates and reduced backward compatibility, somewhat more frequent updates may be needed, because we have to follow the operating system's lead.
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: MS C/C++ DLLs for Vensim DSS models

Post by Administrator »

Dr John P Weldon wrote: Mon Aug 03, 2020 11:55 pmAfter implementing advice in the past 24 hours from Administrator Tomfid, I have advanced to 'External function version mismatch need version 62051 (got 62050)' for one model.
Try modifying your project settings and defining DBLPREC and DPMATH. This should do the trick.
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
Post Reply