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. The .pro file "thefilename.pro" could not be parsed
Forum Updated to NodeBB v4.3 + New Features

The .pro file "thefilename.pro" could not be parsed

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 3.7k Views 2 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.
  • anadimisra27A Offline
    anadimisra27A Offline
    anadimisra27
    wrote on last edited by
    #1

    Hello! I'm trying to build a GUI for my C Code using Qt. The code is building properly and there are no compilation errors (at least not shown). The problem is that the run button is grey and hence I'm not able to run the code. When I hover over it, it displays the message "the .pro file "may12trial2.pro" could not be parsed"
    What could be the problem? I'm new to Qt, just 2 days including today. Help will be appreciated.

    Here is my .pro code;
    QT += core gui

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = May12trial2
    TEMPLATE = app

    SOURCES += main.cpp
    mainwindow.cpp
    mar11_5.c

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui

    Here is the mainwindow.cpp code:
    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <QRegExp>
    #include <QString>
    #include <QStringList>
    #include <QProcess>
    #include <QByteArray>
    #include <QLineEdit>

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

    MainWindow::~MainWindow()
    {
    delete ui;
    }

    void MainWindow::on_pushButton_clicked()
    {

    QString str1,str2, output;
    
    str1 = ui->lineEdit->text();
    str2 = ui->lineEdit_3->text();
    
    QStringList params;
    params << str1 << str2 << output ;
    
    QProcess *proc;
    proc->start("./mar11_5.exe", params);
    proc->waitForFinished();
    

    //QString output(proc->readAllStandardOutput());

    QStringList list = output.split("-");
    
    ui->lineEdit_2->setText(QString(list[1]));
    

    }

    Here is the main.cpp code:
    #include "mainwindow.h"
    #include <QApplication>
    #include <iostream>
    #include <stdlib.h>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    return a.exec();
    

    }

    If I'm missing any header too, please let me know. I have included a C file in my project.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      Try to run qmake from build menu
      If pro file is not correct it should show error.

      Also, try make a new default project with New and see if that just runs ?

      the_T anadimisra27A 2 Replies Last reply
      0
      • mrjjM mrjj

        Hi
        Try to run qmake from build menu
        If pro file is not correct it should show error.

        Also, try make a new default project with New and see if that just runs ?

        the_T Offline
        the_T Offline
        the_
        wrote on last edited by
        #3

        @mrjj

        Shouldn't it be

        SOURCES += main.cpp \
        mainwindow.cpp \
        mar11_5.c
        

        instead of

        SOURCES += main.cpp
        mainwindow.cpp
        mar11_5.c
        

        or are the " \ " cut off here for any reason?

        -- No support in PM --

        mrjjM 1 Reply Last reply
        2
        • the_T the_

          @mrjj

          Shouldn't it be

          SOURCES += main.cpp \
          mainwindow.cpp \
          mar11_5.c
          

          instead of

          SOURCES += main.cpp
          mainwindow.cpp
          mar11_5.c
          

          or are the " \ " cut off here for any reason?

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @the_
          yes it should but without code tags it eats them :)

          the_T 1 Reply Last reply
          2
          • mrjjM mrjj

            @the_
            yes it should but without code tags it eats them :)

            the_T Offline
            the_T Offline
            the_
            wrote on last edited by
            #5

            @mrjj

            ah ok
            :)

            -- No support in PM --

            1 Reply Last reply
            1
            • mrjjM mrjj

              Hi
              Try to run qmake from build menu
              If pro file is not correct it should show error.

              Also, try make a new default project with New and see if that just runs ?

              anadimisra27A Offline
              anadimisra27A Offline
              anadimisra27
              wrote on last edited by
              #6

              @mrjj Hello! I did : Run qmake from the build. Still no errors. I also ran a new project, that is working. (just a basic one where if you click a button text gets printed in the line edit).

              In the code that I have written, do I need to include some additional header files or add some code when I'm adding a .c file to my project?

              mrjjM 1 Reply Last reply
              0
              • anadimisra27A anadimisra27

                @mrjj Hello! I did : Run qmake from the build. Still no errors. I also ran a new project, that is working. (just a basic one where if you click a button text gets printed in the line edit).

                In the code that I have written, do I need to include some additional header files or add some code when I'm adding a .c file to my project?

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @anadimisra27
                hi
                no, u can just copy the .c file to the project folder. Then right click project and select
                Add existing file and point to your .c file.

                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