DBLPREC

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

DBLPREC

Post by Dr John P Weldon »

I need to define DBLPREC. Please let me know where and how to do that. '#define DBLPREC' in one of the '.h' files did not work.
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: DBLPREC

Post by Administrator »

I've already given you instructions on what to do here via email. Did they not work?
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
Dr John P Weldon
Member
Posts: 39
Joined: Sun Oct 07, 2018 7:56 pm
Vensim version: DSS

Re: DBLPREC

Post by Dr John P Weldon »

The instructions provided by you in an email dated from some years ago. I have been unable to relate those instructions to the content of project properties in Visual Studio 2022. I have no desire or intention to waste your time or mine on these matters. Nevertheless, I do need additional advice in this case.
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: DBLPREC

Post by Administrator »

I emailed you on the 29th of June 2023 (and you replied to it), not several years ago.

As I said in the email, all versions of Vensim are now double precision. Your DLL is built for Vensim single precision (which is why you are getting the "external function version mismatch need version 62051 (got 62050)" error). So you need to rebuild your DLL to be compatible with double precision Vensim.

To make your DLL compatible with double precision Vensim, you need to define DBLPREC in your DLL project and rebuild.

Please try this and see if it fixes the problem.
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
Dr John P Weldon
Member
Posts: 39
Joined: Sun Oct 07, 2018 7:56 pm
Vensim version: DSS

Re: DBLPREC

Post by Dr John P Weldon »

I have now located a 'define' of DBLPREC (and DPMATH). It is located in vensim.h. The define is as follows.

#ifndef _VENSIM_H_
#define _VENSIM_H_
#define DBLPREC
#define DPMATH

Vensim.h appears at the start of each '.c' suprogram, such as the following.

#line 1
#include <assert.h>
#include <float.h>
#include <malloc.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "c:\users\public\vensim\COMP\vensim.h"
#include "c:\vensim\hosdefs.h"
#include "c:\vensim\hsglob.h"

If you approve of the above define in vensim.h, and of it use in my subprograms, it follows that DBLPREC is not the cause of the syntax error in my Vensim model: 'missing a closing parenthesis on a lookup table call'.

I hope that you can suggest an alternative way of correcting the above error.
Administrator
Super Administrator
Posts: 4590
Joined: Wed Mar 05, 2003 3:10 am

Re: DBLPREC

Post by Administrator »

Have you rebuilt the DLL?

Are you still getting the "external function mismatch" warning?
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: 3811
Joined: Wed May 24, 2006 4:54 am

Re: DBLPREC

Post by tomfid »

Rather than defining these in the code, you probably want to define them in the preprocessor, via /D "DBLPREC". In Visual Studio this is in project properties>C/C++>Preprocessor.
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: DBLPREC

Post by tomfid »

I think this thread viewtopic.php?t=8116 established that the error is caused by a missing : at the beginning of a macro.
Dr John P Weldon
Member
Posts: 39
Joined: Sun Oct 07, 2018 7:56 pm
Vensim version: DSS

Re: DBLPREC

Post by Dr John P Weldon »

Thanks for your advice. The problems appear to have been resolved.
Post Reply