Cannot find file pro qt ошибка с кодом 2

As the title says, I am having an issue with Qt Creator. I started to play with it and created a main() with a some code in it and when I wanted to compile it to see how it would appear on the screen, I am unable to do so, I see the following error:

Cannot find file:
/Users/Eugene/Documents/Qt/Test/test.pro. Le processus
«/Users/Eugene/QtSDK/Desktop/Qt/473/gcc/bin/qmake» terminated with
error cade 2. Error during the compilation of the project Test (build : Desktop)
during the step ‘qmake’

Yet when I go to the folder, I can see the test.pro file there, so I don’t see why Qt is unhappy.

Did anybody have had a similar problem? I couldn’t find any similar question so far.
Thanks in advance for you help,
Regards

Chris's user avatar

Chris

17k5 gold badges56 silver badges60 bronze badges

asked Aug 29, 2011 at 20:12

Born2Discover's user avatar

0

Are you sure that you don’t have space or other ‘weird’ characters in your project’s path? If so, Qt is unhappy.

You may also try to delete the *.pro.user file and try to compile again.
If unfortunately neither of them work, you can try to compile your project on the command line.

cd to the root directory of your project and:

  1. qmake -project
  2. mingw32-make

If this still can’t get your project compiled, you should check your Qt installation.

Mat's user avatar

Mat

201k40 gold badges392 silver badges405 bronze badges

answered Dec 7, 2011 at 13:11

user957121's user avatar

user957121user957121

2,9464 gold badges24 silver badges36 bronze badges

In my case removing non-ascii characters from the path solved the problem. Spaces are fine, at least from my experience.

answered Apr 14, 2015 at 14:47

Piotr Masek's user avatar

I found another solution that worked for me.

QT is cross-platform tool, so it needs some limitations and restrictions.
One of this restriction is correct path to project. It CAN’T contain any spaces!!!

For example

D:Qt projectproject — wrong

is WRONG. (notice space between Qt and Project).
Instead use something like this

D:Qt_projectproject — correct

Community's user avatar

answered Nov 8, 2014 at 11:01

Zdeno Pavlik's user avatar

1

ЧакЭ одобряЭ

285 / 284 / 86

Регистрация: 27.12.2009

Сообщений: 1,767

1

07.12.2011, 19:08. Показов 13811. Ответов 4


Студворк — интернет-сервис помощи студентам

Cannot find file: c:UsersЧакuntitled4untitled4.pro.
Процесс «c:qtsdkdesktopqt4.7.4mingwbinqmake.exe» завершился с кодом 2.
Возникла ошибка при сборке проекта untitled4 (цель: Desktop)
Во время выполнения сборки на этапе «qmake»

ТО же с любым другим проектом



0



Programming

Эксперт

94731 / 64177 / 26122

Регистрация: 12.04.2006

Сообщений: 116,782

07.12.2011, 19:08

Ответы с готовыми решениями:

Файл: Написать программу, которая создает файл содержащий целые числа, и находит наименьшее из чисел, содержащийся в файле.
Написать программу, которая создает файл содержащий целые числа, и находит наименьшее из чисел,…

если находит совподение, то создает текстовый файл — название которого искомый номер, а в сам txt файл встовляет 2 столбец
ривет всем! Ребята подскажите можно ли реализовать такое на С++:

есть excel файл. в нем в первом…

Не находит файл
Подскажите, в чём проблема!

procedure TForm1.FormCreate(Sender: TObject);
var Path: string;

Не находит файл
Привет, не понимаю что это, перенес проект с другого компа :

Помогите

4

Почетный модератор

11308 / 4282 / 439

Регистрация: 12.06.2008

Сообщений: 12,340

07.12.2011, 20:16

2

Qt не любит, когда в имени пути присутствуют русские буквы.



2



Автор FAQ

2732 / 1428 / 89

Регистрация: 08.09.2011

Сообщений: 3,746

Записей в блоге: 1

07.12.2011, 20:30

3

Цитата
Сообщение от Humanoid
Посмотреть сообщение

Qt не любит, когда в имени пути присутствуют русские буквы.

Не по теме:

походу Qt вообще не любит русские буквы :)



0



Humanoid

07.12.2011, 20:32

Не по теме:

Чистый, я в своих приложениях во всю использую… главное кодек настроить вначале. Но QtCreator иногда подвисает очень смачно при переключении раскладки клавиатуры.



1



Автор FAQ

2732 / 1428 / 89

Регистрация: 08.09.2011

Сообщений: 3,746

Записей в блоге: 1

07.12.2011, 21:24

5

Цитата
Сообщение от Humanoid
Посмотреть сообщение

Не по теме:

Чистый, я в своих приложениях во всю использую… главное кодек настроить вначале. Но QtCreator иногда подвисает очень смачно при переключении раскладки клавиатуры.

Не по теме:

да я тоже :) у меня тоже вешается при смене раскладки, а так как у меня стоит PuntoSwitcher то довольно таки часто это бывает, но вот в Lin дома такого я не замечал ….



0



IT_Exp

Эксперт

87844 / 49110 / 22898

Регистрация: 17.06.2006

Сообщений: 92,604

07.12.2011, 21:24

Помогаю со студенческими работами здесь

Не находит файл
господа программисты, подскажите почему выдает что файл не существует?? или как прописать путь к…

не находит файл
var
f:text;
names:array of string;
counts:array of integer;
i,n:integer;
s:string;…

Не находит файл
Не могу понять, что не так в коде. Пишет, что файл не найден, хотя через файл экслорер в андроид…

Не находит файл!
Всем доброго времени суток.

Сразу к делу:
есть папка которая лежит в appDtata в roaming…

Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:

5

Доброго времени суток.

Только поставил QT 5.6 и сразу словил ошибку.
Код:

#include <QApplication>
#include <QPushButton>

int main(int argc, char **argv)
{
 QApplication app (argc, argv);

 QPushButton button («Hello world !»);
 button.show();

 return app.exec();
}

Текст консоли сборки:

22:59:51: Выполняются этапы для проекта Hello…
22:59:51: Запускается: «C:Qt5.6mingw49_32binqmake.exe» F:С++LearnQTHelloHello.pro -r -spec win32-g++ «CONFIG+=debug» «CONFIG+=qml_debug»
Cannot find file: F:С++LearnQTHelloHello.pro.
22:59:51: Процесс «C:Qt5.6mingw49_32binqmake.exe» завершился с кодом 2.
Ошибка при сборке/установке проекта Hello (комплект: Desktop Qt 5.6.0 MinGW 32bit)
Во время выполнения этапа «qmake»
22:59:51: Прошло времени: 00:00.

Подскажите, в чем может быть проблема?

Что делать, если QT Creator под windows не находит файл проекта (.pro) и в лог постройки пишет следующее:

17:57:56: Running steps for project first...
17:57:56: Starting: "C:Qt4.8.4binqmake.exe" "D:мои документыQTfirstfirst.pro" -r -spec win32-g++ "CONFIG+=declarative_debug"
Cannot find file: d:мои документыQTfirstfirst.pro.
17:57:56: The process "C:Qt4.8.4binqmake.exe" exited with code 2.
Error while building/deploying project first (target: Desktop)
When executing step 'qmake'

Following is the output of the error —

18:29:31: Running steps for project BCSEIII…
18:29:31: Configuration unchanged, skipping qmake step.
18:29:31: Starting: «C:QtToolsmingw810_64binmingw32-make.exe» -j8
C:/Qt/6.1.3/mingw81_64/bin/qmake.exe -o Makefile «../templateProgram.rar (Unzipped Files)/BCSEIII.pro» -spec win32-g++ CONFIG+=debug CONFIG+=qml_debug
Cannot find file: ..templateProgram.rar.
Cannot find file: (Unzipped.
Cannot find file: Files)BCSEIII.pro.
mingw32-make: *** [Makefile:204: Makefile] Error 2
18:29:32: The process «C:QtToolsmingw810_64binmingw32-make.exe» exited with code 2.
Error while building/deploying project BCSEIII (kit: Desktop Qt 6.1.3 MinGW 64-bit)
When executing step «Make»
18:29:32: Elapsed time: 00:01.

Here is the code of .pro file —

#————————————————-

Project created by QtCreator 2018-07-19T19:54:40

#————————————————-

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = BCSEIII
TEMPLATE = app

The following define makes your compiler emit warnings if you use

any feature of Qt which has been marked as deprecated (the exact warnings

depend on your compiler). Please consult the documentation of the

deprecated API in order to know how to port your code away from it.

DEFINES += QT_DEPRECATED_WARNINGS

You can also make your code fail to compile if you use deprecated APIs.

In order to do so, uncomment the following line.

You can also select to disable deprecated APIs only up to a certain version of Qt.

#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

SOURCES +=
main.cpp
mainwindow.cpp
my_label.cpp

HEADERS +=
mainwindow.h
my_label.h

FORMS +=
mainwindow.ui

I am using qt 6 in windows 10.

How can i fix the error?

Возможно, вам также будет интересно:

  • Cannot convert int to int ошибка
  • Cannot connect to mysql server ошибка
  • Cannot communicate with server ошибка
  • Cannot be resolved to a variable java ошибка
  • Cannot be resolved to a type ошибка java

  • Понравилась статья? Поделить с друзьями:
    0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии