redefinition of "class GtkwidgetDef" - c++

I really don't know why i have this redefinition error
GtkwidgetDef.h
#include <gtk/gtk.h>
class GtkwidgetDef
{
public:
GtkWidget* display;
GtkwidgetDef(GtkButton* button);
};
GtkwidgetDef.cpp
#include "GtkwidgetDef.h"
extern "C" GtkWidget* lookup_widget(GtkWidget* widget, const gchar* widgetName);
GtkwidgetDef::GtkwidgetDef(GtkButton* button){
display = lookup_widget(GTK_WIDGET(button), "display");
}
these two fonctions are juste definition and constructor
MesFonctions.cpp
#include "MesFonctions.h"
#include <math.h>
string str;
gchar str1[9] = "";
void showText(GtkwidgetDef widgets, gchar* label)
{
gtk_entry_set_text(GTK_ENTRY(widgets->display), label);
}
.........
CALCU.h
#include <gtk/gtk.h>
typedef enum Event{ SEVEN_CLICKED, PLUS_CLICKED, VALIDE } Event;
int processEvent(Event e, GtkButton* button);
CALCU.cpp
#include "CALCU.h"
#include "MesFonctions.h"
#include "GtkwidgetDef.h"
int processEvent(Event e, GtkButton* button)
{
//GtkwidgetDef* widgets = new GtkwidgetDef();
//label = gtk_button_get_label(button);
GtkwidgetDef widgets(button);
gchar* label;
strcpy(label, gtk_button_get_label(button));
string s;
switch(e)
{
case SEVEN_CLICKED:
//showText(*widgets, label);
showText(widgets, label);
s = "7";
pushValue(s);
break;
case PLUS_CLICKED:
//showText(*widgets, label);
showText(widgets, label);
s = "+";
pushValue(s);
break;
case VALIDE:
showResult();
break;
}
}
i wonder if i make an error here in this line GtkwidgetDef widgets(button);

I think the reason you are seeing this is that you include GtkwidgetDef.h twice at some point: once directly and once indirectly. You probably need to add an include guard to your header:
#ifndef GtkwidgetDef_h
#define GtkwidgetDef_h
#include <gtk/gtk.h>
class GtkwidgetDef
{
public:
GtkWidget* display;
GtkwidgetDef(GtkButton* button);
};
#endif

Related

QT Multithread application crashing when I try to start threads

I am having issues when I try to create an application that simulates a restaurant. It needs to have 50 clients, 3 cooks, 1 waiter and 30 tables. When I try to start the threads of the clients, cooks and waiter it crashes and doesnt let me do anything, nor it gives me an error message or warning. I really don't know what to do. I hope you guys can help me with the answer.
Cook class.h:
`
#ifndef COOK_H
#define COOK_H
#include <QObject>
#include <QThread>
#include <QSemaphore>
class Cook : public QThread
{
Q_OBJECT
public:
Cook(int id, QString name);
void makeFood(int queueTotal);
void startCook();
private:
int id;
QString name;
int orderId;
QSemaphore semaphore;
protected:
void run(); //makeFood
};
#endif // COOK_H
cook.cpp
#include "cook.h"
#include <QTextStream>
Cook::Cook(int id, QString name)
{
this->id = id;
this->name = name;
}
void Cook::startCook(){
run();
}
void Cook::run(){
QTextStream(stdout)<< "hello im a cook";
}
`
client.h
`
#ifndef CLIENT_H
#define CLIENT_H
#include <QObject>
#include <QThread>
#include <QSemaphore>
class Order;
class Client : public QThread
{
Q_OBJECT
public:
Client(int id, QString name);
void setOrder(Order* order);
int getId();
void startClient();
private:
int id;
QString name;
QSemaphore semaphore;
Order* order;
protected:
void run();
};
#endif // CLIENT_H
`
client.cpp
`
#include "client.h"
#include <QTextStream>
Client::Client(int id, QString name)
{
this->id = id;
this->name = name;
}
void Client::startClient(){
run();
}
void Client::run(){
QTextStream(stdout)<< "hello im a client";
}
void Client::setOrder(Order* order){
this->order = order;
}
int Client::getId(){
return this->id;
}
`
order.cpp and .h
`
#ifndef ORDER_H
#define ORDER_H
class Order
{
public:
Order(int orderId, bool orderType);
private:
int orderId;
bool orderType; //true carne - false vegano
};
#endif // ORDER_H
`
order.cpp
`
#include "order.h"
Order::Order(int orderId, bool orderType)
{
this->orderId = orderId;
this->orderType = orderType;
}
table.h and cpp
#ifndef TABLE_H
#define TABLE_H
#include <QObject>
class Client;
class Table
{
public:
Table(int id, QString name, bool seat);
void clearClient();
void setClient(Client newClient);
private:
int id;
QString name;
bool seat;
int clientId;
};
#endif // TABLE_H
table.cpp
#include "table.h"
#include "client.h"
Table::Table(int id, QString name, bool seat)
{
this->seat = seat;
this->clientId = 0;
this->id = id;
this->name = name;
}
void Table::clearClient(){
this->seat = false;
this->clientId = -1;
}
void Table::setClient(Client newClient){
this->clientId = newClient.getId();
this->seat = true;
}
`
waiter.h
`
#ifndef WAITER_H
#define WAITER_H
#include <QObject>
#include <QThread>
#include <QSemaphore>
class Waiter : public QThread
{
Q_OBJECT
public:
Waiter(int id, QString name);
void startWaiter();
private:
int id;
QString name;
int orderId;
int tableId;
QSemaphore semaphore;
protected:
void run();
};
#endif // WAITER_H
`
waiter.cpp
`
#include "waiter.h"
#include <QTextStream>
Waiter::Waiter(int id, QString name)
{
this->id = id;
this->name = name;
}
void Waiter::startWaiter(){
run();
}
void Waiter::run(){
QTextStream(stdout)<< "hello im a waiter";
}
`
restaurant.h
`
#ifndef RESTAURANT_H
#define RESTAURANT_H
class Restaurant
{
public:
Restaurant();
void startRestaurant(int totalChefs, int totalTables, int totalWaiters, int totalClients);
};
#endif // RESTAURANT_H
`
restaurant.cpp
`
#include "restaurant.h"
#include <QThread>
#include "cook.h"
#include "client.h"
#include "waiter.h"
#include "table.h"
Restaurant::Restaurant()
{
}
void Restaurant::startRestaurant(int totalChefs, int totalTables, int totalWaiters, int totalClients){
QList <Cook*> cookList;
QList <Waiter*> waiterList;
QList <Client*> clientList;
QList <Table*> tables;
//start
for(int i=0; i<totalChefs; i++){
QString output = QStringLiteral("Cook %1").arg(i);
Cook cook(i, output);
cookList.append(&cook);
}
for(int i=0; i<totalWaiters; i++){
QString output = QStringLiteral("Waiter %1").arg(i);
Waiter waiter(i, output);
waiterList.append(&waiter);
}
for(int i=0; i<totalClients; i++){
QString output = QStringLiteral("Client %1").arg(i);
Client client(i, output);
clientList.append(&client);
}
for(int i=0; i<totalTables; i++){
QString output = QStringLiteral("Table %1").arg(i);
Table table(i, output, false);
tables.append(&table);
}
cookList.value(1)->startCook();
waiterList.value(1)->startWaiter();
clientList.value(1)->startClient();
}
`
I am new to QT so please bear that in mind, I hope you guys can help me!

c2653 no class or namespace .hpp/.cpp

Hey I'm a C++ beginner and trying to learn the basics. I tried to compile my code but it keeps telling me
error. (c2653) "Framework": no class or namespace in line 4.
Another error is
"sf":no class or namespace
but if I add #include <SFML\Graphics.hpp> to my Framework.cpp code it solve the problem. As I understand the .hpp headers include all the code to the cpp files. So why should I include the SFML\Graphics.hpp twice?
Here is my Code:
#ifndef FRAMEWORKK_H
#define FRAMEWORKK_H
#include <iostream>
#include <SFML\Graphics.hpp>
#include "stdafx.h"
class Framework
{
public:
Framework();
~Framework();
void run();
private:
void quit();
void update();
void handleEvent();
void render();
sf::RenderWindow * pRenderWindow;
sf::Event * pMainEvent;
bool mRun;
};#endif
and here is my .cpp code
#include "Frameworkk.h"
#include "stdafx.h"
Framework::Framework(){
pRenderWindow = new sf::RenderWindow(sf::VideoMode(800, 600, 32),
"Spiel");
pMainEvent = new sf::Event;
mRun = true;
}
Framework::~Framework()
{
}
void Framework::run()
{
while (mRun)
{
update();
handleEvent();
render();
quit();
}
}
void Framework::quit()
{
if (!mRun)
{
pRenderWindow->close();
}
}
void Framework::update()
{
}
void Framework::handleEvent()
{
while (pRenderWindow->pollEvent(*pMainEvent))
{
if (pMainEvent->type == sf::Event::Closed)
{
mRun = false;
}
}
}
void Framework::render()
{
pRenderWindow->clear(sf::Color(120, 120, 120));
pRenderWindow->display();
}

QObject::connect: No such signal progressbarV::keyReleaseEvent()

I am trying to create a project in which I have a progressbarV class which creates a QProgressBar. I am calling this class in my mainWindow. My aim is to navigate to another screen when I click on the progressbar. I tried to implement KeyRleaseEvent for this purpose, but no matter what I do, I keep getting the error "QObject::connect: No such signal progressbarV::keyReleaseEvent()". I would much appreciate any help I could get to resolve this issue.
Please find my code below:-
mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QWidget>
#include <QProgressBar>
#include <QLabel>
#include <QPixmap>
#include <QPushButton>
#include <QtWidgets>
#include <QProcess>
#include "headerfiles/progressbarV.h"
#include "headerfiles/redzonesettingsscreen.h"
class progressbarH;
class redZoneSettingsScreen;
class MainWindow : public QMainWindow//,public QProcess
{
Q_OBJECT
private:
progressbarV *progressbar_V_left;
public:
MainWindow();
~MainWindow();
void GetObjects(redZoneSettingsScreen *);
private slots:
void handleSettingsButtonPressed();
/*protected:
virtual void keyReleaseEvent(QKeyEvent *); //Q_DECL_OVERRIDE;*/
};
#endif // MAINWINDOW_H
mainwindow.cpp
#include "headerfiles/mainwindow.h"
redZoneSettingsScreen *gotoSettingsScreen;
MainWindow::MainWindow()
{
progressbar_V_left = new progressbarV;
progressbar_V_left->setParent(this);
progressbar_V_left->setGeometry(350,200,90,450);
progressbar_V_left->setTitle("Height");
progressbar_V_left->setData(labelCurHeight->getDataValue());
progressbar_V_left->setMinVal(0);
progressbar_V_left->setMaxVal(labelMaxHeight->getDataValue());
connect(progressbar_V_left, SIGNAL (keyReleaseEvent()), this, SLOT
(handleSettingsButtonPressed()));
}
MainWindow::~MainWindow()
{
delete progressbar_V_left;
}
void MainWindow::GetObjects(redZoneSettingsScreen *button)
{
gotoSettingsScreen = button;
}
void MainWindow::handleSettingsButtonPressed()
{
gotoSettingsScreen->hide();
gotoSettingsScreen->show();
this->hide();
}
/*void MainWindow::keyReleaseEvent(QKeyEvent *event)
{
}*/
progressbarV.h
#ifndef PROGRESSBARV_H
#define PROGRESSBARV_H
#include <QWidget>
#include <QProgressBar>
#include <QLabel>
#include <QPixmap>
class progressbarV: public QWidget
{
Q_OBJECT
private:
QProgressBar *progressbar_V;
QLabel *labelRedDanger, *labelYellowWarning;
float maxScaledHeight, redZoneScaledHeight, yellowZoneScaledHeight;
int spn, spn_value;
QString title;
int data;
short minVal;
short maxVal;
public:
progressbarV();
~progressbarV();
void setSPN(int);
int getSPN();
void setSPN_Value(int);
int getSPN_Value();
void setTitle(QString);
QString getTitle();
void setData(int);
int getData();
void setMinVal(short);
short getMinVal();
void setMaxVal(short);
short getMaxVal();
/*void setLowError(short);
short getLowError();
void setLowWarning(short);
short getLowWarning();
void setHighError(short);
short getHighError();
void setHighWarning(short);
short getHighWarning();*/
QProgressBar* getProgressBarV();
protected:
void keyReleaseEvent(QKeyEvent *); //Q_DECL_OVERRIDE;
};
#endif // PROGRESSBARH_H
progressbarV.cpp
#include "headerfiles/progressbarV.h"
progressbarV::progressbarV()
{
progressbar_V = new QProgressBar;
progressbar_V->setParent(this);
progressbar_V->setStyleSheet("QProgressBar{ border: solid grey; border-
width: 6; border-radius: 12; text-align: center;},
QProgressBar::chunk{background-color: limegreen; width: 0px; margin:
0px;}");
progressbar_V->setGeometry(2,0,50,200);
progressbar_V->setOrientation(Qt::Vertical);
maxScaledHeight = (200*100)/120;
redZoneScaledHeight = 200 - ((maxScaledHeight*105)/100);
yellowZoneScaledHeight = 200 - ((maxScaledHeight*90)/100);
QPixmap mypixRed(":/images/images/redZone.png");
labelRedDanger = new QLabel;
labelRedDanger->setParent(this);
labelRedDanger->setGeometry(8,redZoneScaledHeight,38,3);
labelRedDanger->setPixmap(mypixRed);
QPixmap mypixYellow(":/images/images/yellowZone.png");
labelYellowWarning = new QLabel;
labelYellowWarning->setParent(this);
labelYellowWarning->setGeometry(8,yellowZoneScaledHeight,38,3);
labelYellowWarning->setPixmap(mypixYellow);
}
progressbarV::~progressbarV()
{
delete progressbar_V;
delete labelRedDanger;
delete labelYellowWarning;
}
void progressbarV::setSPN(int val)
{
spn = val;
}
int progressbarV::getSPN()
{
return spn;
}
void progressbarV::setSPN_Value(int val)
{
spn_value = val;
}
int progressbarV::getSPN_Value()
{
return spn_value;
}
void progressbarV::setTitle(QString mTitle)
{
title = mTitle;
}
QString progressbarV::getTitle()
{
return title;
}
void progressbarV::setData(int mData)
{
data = mData;
progressbar_V->setValue(data);
}
int progressbarV::getData()
{
return data;
}
void progressbarV::setMinVal(short mMinVal)
{
minVal = mMinVal;
progressbar_V->setMinimum(minVal);
}
short progressbarV::getMinVal()
{
return minVal;
}
void progressbarV::setMaxVal(short mMaxVal)
{
maxVal = mMaxVal;
progressbar_V->setMaximum(maxVal);
}
short progressbarV::getMaxVal()
{
return maxVal;
}
QProgressBar *progressbarV::getProgressBarV()
{
return progressbar_V;
}
void progressbarV::keyReleaseEvent(QKeyEvent *event)
{
}
Since I am new to QT, kindly give me solutions in the form of code snippets
Thanks in advance,
Sam
you need to declare keyReleaseEvent as a public SLOT
public slots:
void keyReleaseEvent(QKeyEvent *); //Q_DECL_OVERRIDE;
so that QT can connect to it using the old connection style.

I don't understand how to make buttons in FLTK

#include "std_lib_facilities_4.h"
#include "Window.h"
#include "Graph.h"
#include "GUI.h"
#include <FL/Fl_Image.H>
using namespace Graph_lib;
using namespace std;
struct Lines_window:Graph_lib::Window{
Lines_window(Point xy, int w, int h, const string& title);
Button button_1;
Button button_2;
static void cb_change_color(Address, Address);
static void cb_change_picture(Address, Address);
};
Lines_window::Lines_window(Point xy, int w, int h, const string& title) :
Window(xy, w, h, title),
button_1(Point(x_max()/2, y_max()/2), 200, 100, "Button 1", cb_change_color),
button_2(Point(x_max()/3, y_max()/3), 200, 100, "Button 2", cb_change_picture)
{
attach(button_1);
attach(button_2);
}
void Lines_window::cb_change_color(Address, Address pw)
{
}
void Lines_window::cb_change_picture(Address, Address pw)
{
}
int main()
try {
if(H112 != 201401L)error("Error: incorrect std_lib_facilities_4.h version ", H112);
using namespace Graph_lib;
Lines_window win(Point(100,100),600,400,"Buttons");
return gui_main();
return 0;
}
catch(exception& e) {
cerr << "exception: " << e.what() << '\n';
return 1;
}
catch (...) {
cerr << "Some exception\n";
return 2;
}
This is my button code. I am trying to make two buttons, one that changes color when you press it and another that puts an image on the button when you press it. I haven't made a callback yet because this won't compile. Errors are:
GUI.cpp:16:6: error: prototype for ‘void Graph_lib::Button::attach(Graph_lib::Window&, Fl_Color)’ does not match any in class ‘Graph_lib::Button’
void Button::attach(Window& win, Fl_Color color)
^
In file included from GUI.cpp:10:0:
GUI.h:66:14: error: candidate is: virtual void Graph_lib::Button::attach(Graph_lib::Window&)
void attach(Window&);
^
Do I need callbacks to compile? I am basing this code off of my professor's code here. I took everything out except for the buttons so I could make them. The GUI.cpp and GUI.h were given to us. What am I doing wrong?
GUI.cpp
//
// This is a GUI support code to the chapters 12-16 of the book
// "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup
//
#include <FL/Fl.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Output.H>
#include "GUI.h"
namespace Graph_lib {
//------------------------------------------------------------------------------
void Button::attach(Window& win, Fl_Color color)
{
pw = new Fl_Button(loc.x, loc.y, width, height, label.c_str());
pw->color(BLUE);
pw->callback(reinterpret_cast<Fl_Callback*>(do_it), &win); // pass the window
own = &win;
}
//------------------------------------------------------------------------------
int In_box::get_int()
{
Fl_Input& pi = reference_to<Fl_Input>(pw);
// return atoi(pi.value());
const char* p = pi.value();
if (!isdigit(p[0])) return -999999;
return atoi(p);
}
//------------------------------------------------------------------------------
string In_box::get_string()
{
Fl_Input& pi = reference_to<Fl_Input>(pw);
return string(pi.value());
}
//------------------------------------------------------------------------------
void In_box::attach(Window& win)
{
pw = new Fl_Input(loc.x, loc.y, width, height, label.c_str());
own = &win;
}
//------------------------------------------------------------------------------
void Out_box::put(const string& s)
{
reference_to<Fl_Output>(pw).value(s.c_str());
}
//------------------------------------------------------------------------------
void Out_box::attach(Window& win)
{
pw = new Fl_Output(loc.x, loc.y, width, height, label.c_str());
own = &win;
}
//------------------------------------------------------------------------------
int Menu::attach(Button& b)
{
b.width = width;
b.height = height;
switch(k) {
case horizontal:
b.loc = Point(loc.x+offset,loc.y);
offset+=b.width;
break;
case vertical:
b.loc = Point(loc.x,loc.y+offset);
offset+=b.height;
break;
}
selection.push_back(b); // b is NOT OWNED: pass by reference
return int(selection.size()-1);
}
//------------------------------------------------------------------------------
int Menu::attach(Button* p)
{
Button& b = *p;
b.width = width;
b.height = height;
switch(k) {
case horizontal:
b.loc = Point(loc.x+offset,loc.y);
offset+=b.width;
break;
case vertical:
b.loc = Point(loc.x,loc.y+offset);
offset+=b.height;
break;
}
selection.push_back(&b); // b is OWNED: pass by pointer
return int(selection.size()-1);
}
//------------------------------------------------------------------------------
} // of namespace Graph_lib
GUI.h
//
// This is a GUI support code to the chapters 12-16 of the book
// "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup
//
#ifndef GUI_GUARD
#define GUI_GUARD
#include "Window.h"
#include "Graph.h"
namespace Graph_lib {
//------------------------------------------------------------------------------
typedef void* Address; // Address is a synonym for void*
typedef void(*Callback)(Address, Address); // FLTK's required function type for all callbacks
//------------------------------------------------------------------------------
template<class W> W& reference_to(Address pw)
// treat an address as a reference to a W
{
return *static_cast<W*>(pw);
}
//------------------------------------------------------------------------------
class Widget {
// Widget is a handle to an Fl_widget - it is *not* an Fl_widget
// We try to keep our interface classes at arm's length from FLTK
public:
Widget(Point xy, int w, int h, const string& s, Callback cb)
: loc(xy), width(w), height(h), label(s), do_it(cb)
{}
virtual void move(int dx,int dy) { hide(); pw->position(loc.x+=dx, loc.y+=dy); show(); }
virtual void hide() { pw->hide(); }
virtual void show() { pw->show(); }
virtual void attach(Window&) = 0;
Point loc;
int width;
int height;
string label;
Callback do_it;
virtual ~Widget() { }
protected:
Window* own; // every Widget belongs to a Window
Fl_Widget* pw; // connection to the FLTK Widget
private:
Widget& operator=(const Widget&); // don't copy Widgets
Widget(const Widget&);
};
//------------------------------------------------------------------------------
struct Button : Widget {
Button(Point xy, int w, int h, const string& label, Callback cb)
: Widget(xy,w,h,label,cb)
{}
void attach(Window&);
};
//------------------------------------------------------------------------------
struct In_box : Widget {
In_box(Point xy, int w, int h, const string& s)
:Widget(xy,w,h,s,0) { }
int get_int();
string get_string();
void attach(Window& win);
};
//------------------------------------------------------------------------------
struct Out_box : Widget {
Out_box(Point xy, int w, int h, const string& s)
:Widget(xy,w,h,s,0) { }
void put(int);
void put(const string&);
void attach(Window& win);
};
//------------------------------------------------------------------------------
struct Menu : Widget {
enum Kind { horizontal, vertical };
Menu(Point xy, int w, int h, Kind kk, const string& label)
: Widget(xy,w,h,label,0), k(kk), offset(0)
{}
Vector_ref<Button> selection;
Kind k;
int offset;
int attach(Button& b); // Menu does not delete &b
int attach(Button* p); // Menu deletes p
void show() // show all buttons
{
for (unsigned int i = 0; i<selection.size(); ++i)
selection[i].show();
}
void hide() // hide all buttons
{
for (unsigned int i = 0; i<selection.size(); ++i)
selection[i].hide();
}
void move(int dx, int dy) // move all buttons
{
for (unsigned int i = 0; i<selection.size(); ++i)
selection[i].move(dx,dy);
}
void attach(Window& win) // attach all buttons
{
for (int i=0; i<selection.size(); ++i) win.attach(selection[i]);
own = &win;
}
};
//------------------------------------------------------------------------------
} // of namespace Graph_lib
#endif // GUI_GUARD
I found the answer. It wouldn't compile because I added an argument to be passed to button (the Fl_Color). I will have to figure out a way to pass a value to the button to change the color.

'drv' does not name a type

Been looking for awhile and I cant find an answer. All paths are included. I'm referencing a class in another namespace in the class I'm creating.
I'm getting the following error:
src/app/Application.h:30:9: error: 'drv' does not name a type
Code Below. Any help is appreciated!
Main.cpp
int main(int argc, char** argv) {
app::Application program;
program.run();
return 0;
}
LEDs.h
#ifndef LEDS_H
#define LEDS_H
namespace drv {
class LEDs {
public:
LEDs();
void InitLEDs(void);
void SetLEDs(const uint8_t value);
private:
static const uint8_t NUM_LEDs = 5;
};
}
#endif /* LEDS_H */
Application.h
#ifndef APPLICATION_H
#define APPLICATION_H
namespace app {
enum State {
NORMAL = 0,
ZONE,
PAIRING,
STUCK,
BATT,
OFF
};
class Application {
public:
Application();
void run(void);
void execute_loop(void);
private:
bool IDLE;
State STATE;
drv::LEDs Leds; // LINE 30
};
}
#endif // APPLICATION_H
Application.cpp
#include "stdint.h"
#include "stdbool.h"
#include "../drv/LEDs.h"
#include "Application.h"
namespace app {
Application::Application() {
IDLE = false;
STATE = NORMAL;
}
void Application::run(void) {
Leds.InitLEDs();
while(1)
{
if(IDLE) {
PowerSaveIdle();
}
else {
execute_loop();
}
}
}
void Application::execute_loop(void)
{
}
}
LEDs.cpp
#include <stdint.h>
#include "LEDs.h"
namespace drv {
LEDs::LEDs() {
}
void LEDs::InitLEDs() {
SetLEDs(0xff);
}
void LEDs::SetLEDs(const uint8_t value) {
//Removed for readability
}
}
You're missing an #include ... line in Application.h. At the top of that file (or just after the inclusion guards) add the line
#include "LEDs.h"