Thanks - that has helped me move forward, but not there yet. I found both "QHostInfo" and "qhostinfo.h" in "/usr/include/arm-linux-gnueabihf/qt5/QtNetwork/", with the former simply calling up the latter. When I add either to the include list wiith the full path, I no longer get an error message with a line number against "HostName = QHostInfo::localHostName();", but instead get one as follows:
which looks as if it can't find the code for the localHostName function, so your -l option looks hopeful. However I cannot find where in the QT options I should insert this - is it the Platform Linker flags?In function 'MainWindow ::MainWindow(QWidget*): mainwindow.o
undefined reference to 'QHostInfo:localHostName()' mainwindow.cpp
collect2: error: Id returned 1 exit status
I'm using the default Pi QT5 setup which I think uses qmake, with QtCreator.
Excuse my ignorance, but where are the linker options specified?
Due to my silly mistake - nothing to do with the above problems.
That's a neater solution, thanks. The include statement is now "#include <QHostInfo>", and the LIBS addition is no longer needed.
Users browsing this forum: No registered users and 4 guests