The .pro file "thefilename.pro" could not be parsed
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
HEADERS += mainwindow.h
FORMS += mainwindow.ui
Here is the mainwindow.cpp code:
MainWindow::MainWindow(QWidget *parent) :
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();
QStringList list = output.split("-"); ui->lineEdit_2->setText(QString(list));
Here is the main.cpp code:
int main(int argc, char *argv)
QApplication a(argc, argv);
If I'm missing any header too, please let me know. I have included a C file in my project.
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 ?
Shouldn't it be
SOURCES += main.cpp \ mainwindow.cpp \ mar11_5.c
SOURCES += main.cpp mainwindow.cpp mar11_5.c
or are the " \ " cut off here for any reason?
yes it should but without code tags it eats them :)
@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?
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.