Important: Please read the Qt Code of Conduct -

Dependent 'main' does not exist

  • just editing my QT application and after building the error;

    :-1: error: dependent 'main' does not exist.

    has appeared. Any ideas? New to QT so really no idea about the program etc, here is my main file;
    #include "widget.h"
    #include <QApplication>

    int main(int argc, char *argv[])
    QApplication a(argc, argv);
    Widget w;;

    return a.exec&#40;&#41;;

    Widget File

    #include "widget.h"
    #include "ui_widget.h"
    #include "shipHandler.h"
    #include "navalVessels.h"

    Widget::Widget(QWidget *parent) :
    ui(new Ui::Widget)

    SDI::shipHandler shipHandler("ships.txt");
    sh = shipHandler;


    delete ui;

    void Widget::populateCombo()
    for( std::vectorSDI::navalVessels*::const_iterator i = sh.ships.begin(); i != sh.ships.end(); ++i)
    SDI::navalVessels* ship = *i;
    QString qstr = QString::fromStdString(ship->name);

    [edit: add coding tags @ SGaist]

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Can you also share your pro file ?

Log in to reply