run time failure of Code2 (shown in the message)

20 views
Skip to first unread message

swoo

unread,
Oct 19, 2012, 3:28:47 PM10/19/12
to ppp-p...@googlegroups.com
Code 1 and Code 2 shown below both compile fine.
Code 1 runs fine.  But Code 2 fails during run time.  
Error message :  Access violation reading location 0x00000008.

They are identical code as far as I can tell.  What is the difference?


//--------CODE 1--------------------------------------------
#include "Simple_window.h"
#include "Graph.h"
int main() {
Simple_window win(Point(10,10), 600, 500, "Canvas");  
Axis xa(Axis::x, Point(50, 300), 400, 5, "test");
win.attach(xa);
win.show();
Fl::run();
return 0;
}

//---------CODE 2--------------------------------------------
#include "Window.h"
#include "Graph.h"
int main() {
Graph_lib::Window win(Point(10,10), 600, 500, "Canvas");  
Graph_lib::Axis xa(Graph_lib::Axis::x, Point(50, 300), 400, 5, "test");
win.attach(xa);
win.show();
Fl::run();
return 0;
}
//-----------------------------------------------------------------------------
Reply all
Reply to author
Forward
0 new messages