1

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:

  1. 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/
  2. 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
    
  3. 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

  4. 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.

  5. 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.

enter image description here

Mohammad Kanan
  • 4,452
  • 10
  • 23
  • 47
Jeffrey Harper
  • 748
  • 7
  • 7
  • 1
    Check your project configuration in _Project > Properties: C/C++ Build > Settings_. – howlger Aug 02 '18 at 17:51
  • @howlger There is no C/C++ Build > Settings. There is a C/C++ General section. I posted a screenshot in my question above. – Jeffrey Harper Aug 02 '18 at 19:11
  • I just installed Eclipse and am trying to build a Qt project and I get the same 'Build not configured correctly'. I have installed the qt5-default package using apt and I am running on Ubuntu 18.04. – muman Sep 11 '19 at 20:57

0 Answers0