I'm following along with this tutorial for Webtoolkit: https://www.webtoolkit.eu/wt/doc/tutorial/wt.html
I am running all this on a Rasbian/Debian on a Virtual Machine and I am using C++14
I decided to copy paste the hello.cpp code onto my Desktop and am compiling it like this on my terminal as I was facing linking errors and thus followed along with command line examples in the tutorial:
g++ -std=c++14 -o hello hello.cpp -I/usr/include -L/usr/lib
However I still get:
hello.cpp:1:29: fatal error: Wt/WApplication.h: No such file or directory
#include <Wt/WApplication.h>
My Wt files are located in /usr/include and /usr/lib which is why I used them.
This stackoverflow did not solve my issue: How to Install Wt into a Custom Folder Without "fatal error: Wt/WApplication: No such file or directory"
EDIT: I was able to run the example files located in the Wt folders in /usr/lib/Wt/examples but can't run it on Desktop, I followed the command line examples on the tutorial for linking errors
EDIT 2: The cpp code if it helps, same as tutorial, just copy pasted:
#include <Wt/WApplication.h>
#include <Wt/WBreak.h>
#include <Wt/WContainerWidget.h>
#include <Wt/WLineEdit.h>
#include <Wt/WPushButton.h>
#include <Wt/WText.h>
class HelloApplication : public Wt::WApplication
{
public:
HelloApplication(const Wt::WEnvironment& env);
private:
Wt::WLineEdit *nameEdit_;
Wt::WText *greeting_;
};
HelloApplication::HelloApplication(const Wt::WEnvironment& env)
: Wt::WApplication(env)
{
setTitle("Hello world");
root()->addWidget(std::make_unique<Wt::WText>("Your name, please? "));
nameEdit_ = root()->addWidget(std::make_unique<Wt::WLineEdit>());
Wt::WPushButton *button = root()->addWidget(std::make_unique<Wt::WPushButton>("Greet me."));
root()->addWidget(std::make_unique<Wt::WBreak>());
greeting_ = root()->addWidget(std::make_unique<Wt::WText>());
auto greet = [this]{
greeting_->setText("Hello there, " + nameEdit_->text());
};
button->clicked().connect(greet);
}
int main(int argc, char **argv)
{
return Wt::WRun(argc, argv, [](const Wt::WEnvironment& env) {
return std::make_unique<HelloApplication>(env);
});
}
The Wt include files do not have the .h extension on some OSs. Try
#include <Wt/WApplication>