class Pictar..
[..]
private:
double img[600][600];
Gahh. sizeof(double) is typically what, 8 bytes..
So 8 x 600 x 600 = 2.8MB, all that allocated on the stack? Yikes.
MacArthur, Ian (SELEX) (UK) wrote:
You are creating your Pictar widget on the stack, and there is
insufficient stack space in your runtime environment to support that.
Either increase you stack space (bad) or create the widget on the heap
by "new"ing it (good)...
So true.. that's a lot of stack space.
If you really want to be able to create the widget on the stack,
then at least change the class so that img is a pointer that is
dynamically allocated in the ctor with 'new' or 'malloc()',
instead of as a hard coded array.
You'll probably need that anyway so that different image sizes
can be handled.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.