DBLPREC
-
- Member
- Posts: 39
- Joined: Sun Oct 07, 2018 7:56 pm
- Vensim version: DSS
DBLPREC
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.
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: DBLPREC
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Member
- Posts: 39
- Joined: Sun Oct 07, 2018 7:56 pm
- Vensim version: DSS
Re: DBLPREC
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.
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: DBLPREC
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.
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Member
- Posts: 39
- Joined: Sun Oct 07, 2018 7:56 pm
- Vensim version: DSS
Re: DBLPREC
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.
#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.
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: DBLPREC
Have you rebuilt the DLL?
Are you still getting the "external function mismatch" warning?
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: DBLPREC
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.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: DBLPREC
I think this thread viewtopic.php?t=8116 established that the error is caused by a missing : at the beginning of a macro.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
-
- Member
- Posts: 39
- Joined: Sun Oct 07, 2018 7:56 pm
- Vensim version: DSS
Re: DBLPREC
Thanks for your advice. The problems appear to have been resolved.