PDA

View Full Version : NR and Splus 6.1: DP doubly defined


pauljwhi
05-04-2005, 09:00 AM
I am trying to use Splus inside a C++ program. Along with that, I am using NR.

My compile error is that I have a double definition of DP due to the lines of code,

LibExtern void S_STDCALL DP(s_object *ent); //in Splus's S_extern.h

typedef double DP; //in nrutil_nr.h

Thanks for the help!

Kevin Dolan
06-13-2005, 03:01 PM
This might work.

Near the beginning of the NR.h header file, add the following line:

#define DP NRDP

Then in your own source files, just after your include NR.h, add the line

#undef DP

Of course you will not be able to use the DP typedef for double in your code, but it is just a typedef for double, so that's no big deal.

I think this should work, but I am not certain. I am not completely clear what happens when fucntions containing expressions which were #defined get inlined into code where the expression is no longer defined.


Kevin

pauljwhi
06-15-2005, 05:39 AM
Thanks, I will try that!