I am compiling scientific code that performs numerically intensive calculations. My process is the following:
Code targeted for the CPU is compiled by the Intel C++ Compiler
Code targeted for the GPU is compiled by NVCC
The object files are then linked using the Intel C++ Compiler
To do this, I have written a makefile to perform the necessary steps, and everything is carried out on the command line. Now, I wish to add on a GUI to the program, using Qt, but without using Qt Creator. As a test, I am trying to compile the "Hello World! Desktop application" given here: https://wiki.qt.io/Getting_Started_on_the_Commandline
My interpretation is as follows:
#include <QtGui\QtGui>
#include <QtWidgets\QApplication>
#include <QtWidgets\QLabel>
void test_qt()
{
QApplication app();
QLabel label("Hello, world!");
label.show();
app.exec();
}
I call the function in a main.cpp file. In my makefile, I link with Qt5core.lib, Qt5Gui.lib and Qt5Widgets.lib, and as per the makefile rules, this is compiled with the Intel C++ compiler. However, it gives the following error:
error: expression must have class type
app.exec();
^
My question is as follows: How can I edit my makefile to compile Qt code? I will be needing signals and slots, so moc may be needed according to Can I use Qt without qmake or Qt Creator? but I will not be using uic.