Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Dependent 'main' does not exist

    General and Desktop
    2
    2
    1329
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      horHay last edited by

      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;
      w.show();

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

      }
      Widget File

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

      Widget::Widget(QWidget *parent) :
      QWidget(parent),
      ui(new Ui::Widget)
      {
      ui->setupUi(this);

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

      }

      Widget::~Widget()
      {
      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);
      ui->comboBox->addItem(qstr);
      }
      }
      @

      [edit: add coding tags @ SGaist]

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi and welcome to devnet,

        Can you also share your pro file ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • First post
          Last post