I am trying to use Eclipse to build a Qt5 Widgets app on an Ubuntu 18.04 virtual machine. I'm able to create a Qt project file (.pro) with Eclipse. However, when I try to build it I get an error, "Build not configured correctly." I'd really appreciate any help resolving this. I've used the Eclipse CDT in other projects but this is the first time I've used it with a Qt project. I'd really like to continue using Eclipse for this project.
Details to reproduce follow:
- I created a fresh Ubuntu 18.04.1 desktop install on a virtual machine by installing ubuntu-18.04.1-desktop-amd64.iso downloaded from http://releases.ubuntu.com/18.04/
Installed packages necessary to build Qt5 applications and the JRE to run eclipse.
sudo apt-get install qt5-default qtdeclarative5-dev qtquickcontrols2-5-dev sudo apt-get install qml-module-qtquick-controls sudo apt-get install g++ make sudo apt-get install default-jre
Installed Eclipse CDT downloaded from http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/photon/R/eclipse-cpp-photon-R-linux-gtk-x86_64.tar.gz
Launched Eclipse and created a Qt project. In Eclipse I did File -> New -> C/C++Project. Then, I select "Qt C++/QML Application" template and clicked "Next". I set the project name to "hello" and clicked "Finish". I pressed Ctrl-B to build the project but the message, "Build not configured correctly" appeared in the CDT Build Console.
Next I verified that I did have all the build tools installed to build and run the application by building from the command line.
$ cd eclipse-workspace/hello/ $ qmake Info: creating stash file /home/jdharper/eclipse-workspace/hello/.qmake.stash $ make g++ -c -pipe -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtQuick -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtQml -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o hello.o hello.cpp /usr/lib/qt5/bin/rcc -name hello hello.qrc -o qrc_hello.cpp g++ -c -pipe -O2 -std=gnu++11 -Wall -W -D_REENTRANT -fPIC -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -isystem /usr/include/x86_64-linux-gnu/qt5 -isystem /usr/include/x86_64-linux-gnu/qt5/QtQuick -isystem /usr/include/x86_64-linux-gnu/qt5/QtGui -isystem /usr/include/x86_64-linux-gnu/qt5/QtQml -isystem /usr/include/x86_64-linux-gnu/qt5/QtNetwork -isystem /usr/include/x86_64-linux-gnu/qt5/QtCore -I. -isystem /usr/include/libdrm -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -o qrc_hello.o qrc_hello.cpp g++ -Wl,-O1 -o hello hello.o qrc_hello.o -lQt5Quick -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -lGL -lpthread $ ./hello
At this point the application launched correctly.
Here's a screen shot of my Project > Properties.