Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Dependent 'main' does not exist
Forum Updated to NodeBB v4.3 + New Features

Dependent 'main' does not exist

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.5k Views 1 Watching
  • 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 Offline
    H Offline
    horHay
    wrote on last edited by
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved