while the qt 6.5.1 is Properly installed and also qt vs tools is Properly installed on visual Studio, why I will get a lots of errors about Qt in a normal project using Visual Studio IDE?
-
okay, and what about this errors about the msvcp folder in qt? I then created another qt widgets application, but again the saim errors.
I will send some of the errors here.
Severity Code Description Project File Line Suppression State
Error (active) E0325 inline specifier allowed on function declarations only QtWidgetsApplication5 E:\Qt\Qt\6.6.0\msvc2019_64\include\QtCore\qcontainerinfo.h 76
Error (active) E2386 'constexpr' is not valid here QtWidgetsApplication5 E:\Qt\Qt\6.6.0\msvc2019_64\include\QtCore\qanystringview.h 301
Error (active) E2860 a nonstatic data member cannot be declared as inline QtWidgetsApplication5 E:\Qt\Qt\6.6.0\msvc2019_64\include\QtCore\qanystringview.h 301
Error C1189 #error: "Qt requires a C++17 compiler, and a suitable value for __cplusplus. On MSVC, you must pass the /Zc:__cplusplus option to the compiler." (compiling source file QtWidgetsApplication5.cpp) QtWidgetsApplication5 E:\Qt\Qt\6.6.0\msvc2019_64\include\QtCore\qcompilerdetection.h 1223
how to fix? -
@bozorgmehr As the error says Qt6 requires at least C++17 standard, so go to your project settings -> General -> C++ Language Standard and make sure it's set to C++17 (or higher).
-
@Chris-Kawa okay, I've changed the project settings and it Compiled successfully, but when running the EXE file I will get these errors
QWidgetsApplication8.exe - System Error dialog The code execution cannot proceed because Qt6Cored.dll was not found. Reinstalling the program may fix this problem.
QtWidgetsApplication8.exe - System Error dialog The code execution cannot proceed because Qt6Widgetsd.dll was not found. Reinstalling the program may fix this problem.
I'm sure that the QT installation path is added to path in Environment Variables.
But still this error is exists: I even used the clean option and then rebuild, but still this error is. -
@bozorgmehr said in while the qt 6.5.1 is Properly installed and also qt vs tools is Properly installed on visual Studio, why I will get a lots of errors about Qt in a normal project using Visual Studio IDE?:
I'm sure that the QT installation path is added to path in Environment Variables.
If it would then you would not get those error.
-
When I said that I have added the qt installed path to the path variable, but I get an error, why do you say that if you had added the qt installed path to the path variable, you would not get an error? I am saying that I have done this but I get an error
-
@bozorgmehr said in while the qt 6.5.1 is Properly installed and also qt vs tools is Properly installed on visual Studio, why I will get a lots of errors about Qt in a normal project using Visual Studio IDE?:
I am saying that I have done this but I get an error
Then may it be so - happy searching for another solution.
When the correct path to a dll is in the PATH environment var then noone will get an error that this dll can not be found. -
@bozorgmehr
Out of interest, what happens if you try to run your executable from a Command Prompt, quite outside of VS? -
@bozorgmehr said:
I'm sure that the QT installation path is added to path in Environment Variables
Don't add Qt installation to your PATH. You would have to add both the bin and plugin directories. That's a terrible practice and you can't expect your users to do so either. You should properly deploy your app. See windeployqt. Run it on your exe and it will copy all the necessary files to your app dir.
-
@Chris-Kawa said in while the qt 6.5.1 is Properly installed and also qt vs tools is Properly installed on visual Studio, why I will get a lots of errors about Qt in a normal project using Visual Studio IDE?:
Run it on your exe and it will copy all the necessary files to your app dir.
If my build system would copy me all the Qt dlls around on every time I build the project I would throw it away. Not to say that imo it does not copy the debug dlls (but I may be wrong) so it does not work for debug.
-
@Christian-Ehrlicher said:
If my build system would copy me all the Qt dlls around on every time I build the project I would throw it away.
Thankfully most build systems are very configurable and you can do it the exact amount of times that is needed. Usually once :)
And I know Linux people prefer to have one copy of libraries on the system, but, at least on Windows, local deployment is the only sane way to have your apps. PATH should be off limits for such things. OP already mentioned two different versions of Qt installed. Adding any of them to PATH is a recipe for disaster sooner or later (probably sooner).
Not to say that imo it does not copy the debug dlls (but I may be wrong) so it does not work for debug.
Good news - it does!
-
thanks, my problem solved.
-
-
-