fstream and fstream.h


peterB
01-13-2004, 03:40 PM
Dear NR users,

I use NR in VC++ and every thing works fine. But when I try to put another library within my program I got the C2872 error. I changed <fstream> to <fstream.h>, but I do not solve my problem. Unfortunately the other code do not work with <fstream>. Is there a way to mix it up?

Best regards,

Peter.

geofizyk
04-13-2004, 04:26 AM
Maybe you should try to put the following:
using namespace std;
just after all ur includes.
Regards

Kevin Dolan
07-13-2004, 09:51 AM
You cannot mix the standard library streams (like <fstream>) with the old-style streams (like <fstream.h>). The NR software includes the file <iostream> in the header file "nrutil_nr.h". This means that you cannot use NR in combination with anything that uses the old-style streams.

As near as I can tell, NR only uses streams for its nrerror function, also defined in that header file. You can try modifying it to use <iostream.h> instead. Maybe that will work.


Kevin Dolan