dojo
04-10-2008, 04:22 AM
Hi!
I am using ubunt and the gcc-Version 4.1.2 compiler for generating the executables. In psplot.h I needed to change line 78:
strcpy(cmd,"\"gv\" ");
to get ghostview running. I wrote a small program xscrsho.cpp:
#include "nr3.h"
#include "psplot.h"
#include "scrsho.h"
float banana(float x)
{
float value;
value = -x*x+x*x*x;
return value;
}
int main(void)
{
scrsho(banana);
return 0;
}
I can compile it and run it and the gv window pops up and displays the function in the specified range. However, if I enter a second range, nothing happens. If I close the gv window the program ends with a segmentation fault.
I assume, that problem occurs within the close() method in psplot.h. Do you have any idea why this is happening?
dojo
I am using ubunt and the gcc-Version 4.1.2 compiler for generating the executables. In psplot.h I needed to change line 78:
strcpy(cmd,"\"gv\" ");
to get ghostview running. I wrote a small program xscrsho.cpp:
#include "nr3.h"
#include "psplot.h"
#include "scrsho.h"
float banana(float x)
{
float value;
value = -x*x+x*x*x;
return value;
}
int main(void)
{
scrsho(banana);
return 0;
}
I can compile it and run it and the gv window pops up and displays the function in the specified range. However, if I enter a second range, nothing happens. If I close the gv window the program ends with a segmentation fault.
I assume, that problem occurs within the close() method in psplot.h. Do you have any idea why this is happening?
dojo