I am getting No such file or directory error for every Qt include inserted in C++ code
-
I am trying to compile this for windows client.
I am using Qt 5.
But when I try to build it.
I get these errors -Build started... 1>------ Build started: Project: TS3Tunnel.Client, Configuration: Debug Win32 ------ 1>QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly. 1>main.cpp 1>MainWindow.cpp 1>C:\Users\Scorpion\source\repos\TS3Tunnel\TS3Tunnel.Client\MainWindow.h(26,10): fatal error C1083: Cannot open include file: 'QtWidgets/QMainWindow': No such file or directory (compiling source file MainWindow.cpp) 1>PlaybackAudioGenerator.cpp 1>C:\Users\Scorpion\source\repos\TS3Tunnel\TS3Tunnel.Client\main.cpp(24,10): fatal error C1083: Cannot open include file: 'QtWidgets/QApplication': No such file or directory 1>Client.cpp 1>C:\Users\Scorpion\source\repos\TS3Tunnel\TS3Tunnel.Client\PlaybackAudioGenerator.h(26,10): fatal error C1083: Cannot open include file: 'QBuffer': No such file or directory (compiling source file PlaybackAudioGenerator.cpp) 1>C:\Users\Scorpion\source\repos\TS3Tunnel\TS3Tunnel.Client\Client.h(26,10): fatal error C1083: Cannot open include file: 'QObject': No such file or directory (compiling source file Client.cpp) 1>Done building project "TS3Tunnel.Client.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I am new to Qt. Please help on how to fix this issue.
-
I am trying to compile this for windows client.
I am using Qt 5.
But when I try to build it.
I get these errors -Build started... 1>------ Build started: Project: TS3Tunnel.Client, Configuration: Debug Win32 ------ 1>QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly. 1>main.cpp 1>MainWindow.cpp 1>C:\Users\Scorpion\source\repos\TS3Tunnel\TS3Tunnel.Client\MainWindow.h(26,10): fatal error C1083: Cannot open include file: 'QtWidgets/QMainWindow': No such file or directory (compiling source file MainWindow.cpp) 1>PlaybackAudioGenerator.cpp 1>C:\Users\Scorpion\source\repos\TS3Tunnel\TS3Tunnel.Client\main.cpp(24,10): fatal error C1083: Cannot open include file: 'QtWidgets/QApplication': No such file or directory 1>Client.cpp 1>C:\Users\Scorpion\source\repos\TS3Tunnel\TS3Tunnel.Client\PlaybackAudioGenerator.h(26,10): fatal error C1083: Cannot open include file: 'QBuffer': No such file or directory (compiling source file PlaybackAudioGenerator.cpp) 1>C:\Users\Scorpion\source\repos\TS3Tunnel\TS3Tunnel.Client\Client.h(26,10): fatal error C1083: Cannot open include file: 'QObject': No such file or directory (compiling source file Client.cpp) 1>Done building project "TS3Tunnel.Client.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I am new to Qt. Please help on how to fix this issue.
@sc0rp10n [UPDATE] I have fixed the above issue but now when I build, I get
[QtRunWork] Error starting process \bin\uic.exe: The system cannot find the file specified
After searching online, I know I need to add output directory or QTDIR but do not know where. Please help.
-
The project publishes .vcproj file which is wrong - it only must publish the .pro files where you generate your VisualStudio solution files from. Otherwise the paths to the Qt installation is not correct inside those files (as you can see). Throw away all .vcproj and .sln files and run qmake on the Qt command prompt after you installed the correct Qt version.
-
The project publishes .vcproj file which is wrong - it only must publish the .pro files where you generate your VisualStudio solution files from. Otherwise the paths to the Qt installation is not correct inside those files (as you can see). Throw away all .vcproj and .sln files and run qmake on the Qt command prompt after you installed the correct Qt version.
@Christian-Ehrlicher so i removed all those files, ran
qmake -project
in .client folder and then tried runningqmake <file_name>.pro
. But I got error/warning:Info: creating stash file C:\Users\princ\source\repos\TS3Tunnel\TS3Tunnel.Client\.qmake.stash RCC: Warning: No resources in 'MainWindow.qrc'. RCC: Warning: No resources in 'MainWindow.qrc'.
So, now should I compile it in visual code?
-
@sc0rp10n said in I am getting No such file or directory error for every Qt include inserted in C++ code:
qmake -project
Why? You should not re-create the pro file. You should run
qmake -tp vc
- see https://doc.qt.io/qt-5/qmake-running.html#general-options -
@sc0rp10n said in I am getting No such file or directory error for every Qt include inserted in C++ code:
qmake -project
Why? You should not re-create the pro file. You should run
qmake -tp vc
- see https://doc.qt.io/qt-5/qmake-running.html#general-options@Christian-Ehrlicher the command you mentioned, does not do anything and just prints help of qmake . Here vc is prefix name (from what I understood through docs). But that would be different for mine. How to see that?
Also there is no default .pro file, so why shouldn't I create it? -
I was pretty sure there was a .pro file in the github link you gave me.
Then you have to either fixup the vcproj by yourself where we can't help or create two separate pro files for the both subdirs withqmake -project QT +=widgets
and hope the automatically generated pro file is correct, then runqmake -tp vc
to generate the vcproj files. -
@sc0rp10n said in I am getting No such file or directory error for every Qt include inserted in C++ code:
qmake -project
Why? You should not re-create the pro file. You should run
qmake -tp vc
- see https://doc.qt.io/qt-5/qmake-running.html#general-options@Christian-Ehrlicher in first reply, you said to choose correct version of Qt, so which one should I choose?
-
@Christian-Ehrlicher in first reply, you said to choose correct version of Qt, so which one should I choose?
@sc0rp10n said in I am getting No such file or directory error for every Qt include inserted in C++ code:
so which one should I choose?
Don't know which version - depends on what the repo needs. But it must be for MSVC.
-
@Christian-Ehrlicher in first reply, you said to choose correct version of Qt, so which one should I choose?
-
I was pretty sure there was a .pro file in the github link you gave me.
Then you have to either fixup the vcproj by yourself where we can't help or create two separate pro files for the both subdirs withqmake -project QT +=widgets
and hope the automatically generated pro file is correct, then runqmake -tp vc
to generate the vcproj files.@Christian-Ehrlicher The .pro file is already there for server client but for windows client it can not be used, because both are different. I am running
qmake -project
in windows client folder which creates a different file from the one already present in server client. -
@J-Hilk ok, i am downloading it, can you tell me steps of command to run to build/compile the client? I don't have much +ve experience with it. @Christian-Ehrlicher
-
Hello everybody. I have to admit that the @sc0rp10n problem was double-checked myself. I just can't solve it, I ask for help from someone who might have an idea/solution on how to fix it! Thanks in advance. @Christian-Ehrlicher
Regards.
-
Hello everybody. I have to admit that the @sc0rp10n problem was double-checked myself. I just can't solve it, I ask for help from someone who might have an idea/solution on how to fix it! Thanks in advance. @Christian-Ehrlicher
Regards.
-
@kalek33 hi and welcome to devnet,
The suggestions still holds: use
qmake -project QT+=widgets
In the client folder to create the .pro file.
Then you can use Qt Creator to build it.
-
No, it's the command to generate the Visual Studio project that failed.
-
@kalek33 said in I am getting No such file or directory error for every Qt include inserted in C++ code:
@SGaist Sure, but why didn't he succeed... and if he didn't succeed either?
You do realize that with the information given there's no way to know ?
In between, you can either use Qt Creator to build the project using the pro file or install the Qt VS tools and import the project into Visual Studio. In any case, you are not locked out of progress.
-
@kalek33 said in I am getting No such file or directory error for every Qt include inserted in C++ code:
@SGaist Sure, but why didn't he succeed... and if he didn't succeed either?
You do realize that with the information given there's no way to know ?
In between, you can either use Qt Creator to build the project using the pro file or install the Qt VS tools and import the project into Visual Studio. In any case, you are not locked out of progress.
-
No because I do not have a Windows machine at hand.
However my constations about missing information applies.What did you exactly do ?
Which error messages did you got ?
Which version of Qt are you using ?