For Qt5 the header files of widgets have to be explicitly included. --- dialogbox.hpp 2016-03-02 20:31:01.000000000 +0100 +++ dialogbox.hpp 2016-12-27 21:54:05.335465144 +0100 @@ -22,6 +22,23 @@ #define DIALOGBOX_H #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define BUFFER_SIZE 1024