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;
}
//-----------------------------------------------------------------------------