Shark Boy
asked on
Code::Blocks C++ fatal error
Hi, I have a fatal error and I don't know what to do. I'm learning Code::Blocks with the Sroustrup book. Here my code:
//
// This is a GUI support code to the chapters 12-16 of the book
// "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup
//
#ifndef SIMPLE_WINDOW_GUARD
#define SIMPLE_WINDOW_GUARD 1
#include "GUI.h" // for Simple_window only (doesn't really belong in Window.h)
#include "Graph.h"
using namespace Graph_lib;
//------------------------ ---------- ---------- ---------- ---------- ---------- ----
struct Simple_window : Window {
Simple_window(Point xy, int w, int h, const string& title );
bool wait_for_button(); // simple event loop
private:
Button next_button; // the "next" button
bool button_pushed; // implementation detail
static void cb_next(Address, Address); // callback for next_button
void next(); // action to be done when next_button is pressed
};
//------------------------ ---------- ---------- ---------- ---------- ---------- ----
#endif // SIMPLE_WINDOW_GUARD
//
// This is a GUI support code to the chapters 12-16 of the book
// "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup
//
#ifndef SIMPLE_WINDOW_GUARD
#define SIMPLE_WINDOW_GUARD 1
#include "GUI.h" // for Simple_window only (doesn't really belong in Window.h)
#include "Graph.h"
using namespace Graph_lib;
//------------------------ ---------- ---------- ---------- ---------- ---------- ----
struct Simple_window : Window {
Simple_window(Point xy, int w, int h, const string& title );
bool wait_for_button(); // simple event loop
private:
Button next_button; // the "next" button
bool button_pushed; // implementation detail
static void cb_next(Address, Address); // callback for next_button
void next(); // action to be done when next_button is pressed
};
//------------------------ ---------- ---------- ---------- ---------- ---------- ----
#endif // SIMPLE_WINDOW_GUARD
3.png
//
// This is a GUI support code to the chapters 12-16 of the book
// "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup
//
#ifndef SIMPLE_WINDOW_GUARD
#define SIMPLE_WINDOW_GUARD 1
#include "GUI.h" // for Simple_window only (doesn't really belong in Window.h)
#include "Graph.h"
using namespace Graph_lib;
//------------------------
struct Simple_window : Window {
Simple_window(Point xy, int w, int h, const string& title );
bool wait_for_button(); // simple event loop
private:
Button next_button; // the "next" button
bool button_pushed; // implementation detail
static void cb_next(Address, Address); // callback for next_button
void next(); // action to be done when next_button is pressed
};
//------------------------
#endif // SIMPLE_WINDOW_GUARD
//
// This is a GUI support code to the chapters 12-16 of the book
// "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup
//
#ifndef SIMPLE_WINDOW_GUARD
#define SIMPLE_WINDOW_GUARD 1
#include "GUI.h" // for Simple_window only (doesn't really belong in Window.h)
#include "Graph.h"
using namespace Graph_lib;
//------------------------
struct Simple_window : Window {
Simple_window(Point xy, int w, int h, const string& title );
bool wait_for_button(); // simple event loop
private:
Button next_button; // the "next" button
bool button_pushed; // implementation detail
static void cb_next(Address, Address); // callback for next_button
void next(); // action to be done when next_button is pressed
};
//------------------------
#endif // SIMPLE_WINDOW_GUARD
3.png
Hi Shark Boy,
the error message is pretty clear, it tells you a file GUI.h which is included in you code (with #include) couldn't be found by the compiler.
If this is a sample from the mentioned book you should look if there are preceeding instructions, possibly you can find how to get the missing files. If you already have the needed file(s) you'll have to either move them into your project's folder or add a include directory in your project's configuration in order to make it possible the compiler finds the file.
Hope that helps,
ZOPPO
the error message is pretty clear, it tells you a file GUI.h which is included in you code (with #include) couldn't be found by the compiler.
If this is a sample from the mentioned book you should look if there are preceeding instructions, possibly you can find how to get the missing files. If you already have the needed file(s) you'll have to either move them into your project's folder or add a include directory in your project's configuration in order to make it possible the compiler finds the file.
Hope that helps,
ZOPPO
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This is a GUI support code to the chapters 12-16 of the book
i would assume that gui.h and graph.h were added in an earlier chapter of the tutorial book.if you just started with the book it makes less sense to start somewhere in the middle but from beginning to avoiding basic issues like the one you reported.
Sara
https://msdn.microsoft.com/en-us/library/36k2cdd4.aspx