Compile Qt project from command line using msvc2017 in Windows [duplicate] - qt

Before I start explaining the problem - yes I looked in the Qt forums and website before coming here.
I downloaded and installed the Qt libraries and the IDE. After the installation I got the following:
http://store.picbg.net/pubpic/04/59/4ce35a1b489a0459.png
after I clicked on the command prompt icon I got the following:
http://store.picbg.net/pubpic/79/13/0d46b97041da7913.jpg
When I type "vcvarsall.bat" I get and invalid command error. I am obviously doing something wrong, question is - what exactly?

Your error simply means that vcvarsall.bat is not in a folder that is listed in your PATH environment variable. You can fix that in two ways.
You can set your PATH environment variable to include the folder where vcvarsall.bat is located.
You can cd into the folder where vcvarsall.bat is located and call vcvarsall.bat from there.
In my case (and by default), vcvarsall.bat is located in the following directory:
C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat
EDIT: For Visual Studio 2017, the location has changed. It is now at:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat

Related

Can not load library Qt5Widgets.dll

Error when run FBLTool_0224.exe
I guess you double-clicked in exe file that provides after building in release mode :
For Deploy and create Exe output with QT in windows you should follow this way:
put your compiler path in your system path. now you use mingw81_64 you should set it. something like Qt/tools/mingw81_64/bin
copy exe file that provides after building in release mode in one folder and run mingw81_64 cmd (it has separate cmd)
and cd to that folder path
windeployqt app.exe
This command will get all dll needs for your app and your exe will work .
if you use qml
windeployqt --qmldir (the path of its directory ) app.exe
and also see these youtube videos for more info:
https://www.youtube.com/watch?v=LdSTgR0xJco
https://www.youtube.com/watch?v=hCXAgB6y8eA
installing visual C++ 2010 runtime x86 solved problem

error while execution of qt .exe file using windeployqt

I have a problem with my qt deployment under windows 10. I'm using QtCreator 4.5.1 and Qt 5.11 on Windows 10. I execute my application in release mode. Then I open the command line by running Qt5.11.0 for Desktop(MinGw 5.3.0 32 bit). There I give the path of the release folder (where my exe file exists):
C:\Qt\workspace\build-CanSaveLog2FilterError2DataExploreClass6-Desktop_Qt_5_11_0_MinGW_32bit2-Release\release
After that I type this line:
windeployqt.exe --quick .
and all the necessary .dll files and platforms and plugins will be generated.
When I do this to a simple qt project, it works fine and my exe file can be executed correctly. Whereas when I do the same to my desired project, I can't execute my exe file and I get this error:
This application failed to start because it could not load the Qt platform plugin "windows"
in "", even though it was found. This is usually due to missing dependencies which you can find by setting the env variable QT_DEBUG_PLUGINS to 1.
Available platform plugins are: windows.
Reinstalling the application may fix this problem.
I tried to find dll file by executing it in dependency walker. When I did this, it showed a lot of dll files missing such as "API-MS-WIN-EVENTING-CONTROLLER-L1-1-0.DLL" which doesn't exist even in bin folder of mingw. While if I put the exe file in the bin folder of mingw it works fine.
So I tried to find all the main dll files whose their sub dll files were missing and copied them to the release folder. For example for API-MS-WIN-EVENTING-CONTROLLER-L1-1-0.DLL, I copied Qt5core.DLL to the release folder. But it didn't work again.
I can't understand where the problem is. Could you please help me to resolve it? Since yesterday morning I'm searching and can't find the solution.

How to build a project in qt 5.2.1 for amd64 (setup cl.exe and missing mspdb110.dll file)?

I have installed qt 5.2.1 and Visual Studio 2012 in Windows 7 x64 (I have codepage 1251 if it matters). I use vs11 compiler.
Firstly I tried to run 'Rebuild all' action and I have received an error connected with cl.exe.
Then I added the path to vs11/bin to PATH variable (where cl.exe file is located; strange but it is in Program Files x86 folder) and have received the error: mspdb110.dll is missing. What should I do next? How to build the project?
Add to PATH path of directory with this dll. It's in something like C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\amd64. If you have not such file in entire system, I guess you should reinstall Visual Studio.

Can't Install QtMobility [Windows 64-bit]

I've downloaded and installed the QT SDK and downloaded the QT Mobility source.
Following the provided instructions, I navigated to my QtMobility directory via the Visual Studio Command Prompt (2010)... note, this is the QtMobility dir with the bin, plugins, examples, etc. folders.
D:\
cd D:\Files\Downloads\QtMobility
configure
Regardless of whether I gave configure a -prefix parameter or not, the following output was displayed:
Checking available Qt
4.8.2
Checking make
... Unknown target environment .
Cannot find 'nmake', 'mingw32-make' or 'make' in your PATH
Aborting.
Of course, I then went to see if my computer had nmake in its PATH: the directory is added as follows:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
I went to CMD and typed in "nmake /?" to receive proper output.
What am I doing wrong? When I try to simply run nmake in the QTMobility directory, it displays:
NMAKE : fatal error U1064: MAKEFILE not found and no target specified
Stop.
Help, please! Thank you. :) I will continue attempting debugs on my own...
I suppose this is late but you could simply run the visual studio command prompt, as it has specific env. variables preset to find nmake, etc.

How to build Qwt on Windows

Here's what I've done:
Downloaded qwt-4.2.0-setup-qt230nc.exe from sourceforge
Unpack to C:\Program Files\Qwt
Go to Qt Command Prompt
Run msvc-qmake.bat.
Get the output.
Now the lib directory is created, but it's empty. Also tried opening VS project file, but it doesn't converse to VS2008, because there are no vcproj files. I also tried to do it qmake way:
qmake qwt.pro and then make, but it says make is not recognized. I figured that I could use mingw32-make, but I gave me a lot of compiler errors.
I was hoping I would use Qwt within QtCreator, but sadly failed. Any help appreciated.
I think I've come up with easy solution:
Open QtCreator.
Open project... -> C:\Program Files\Qwt\qwt.pro
Build.
...
PROFIT!!!
Do I guess correctly it's valid way to do this?
Now I need to figure out how to marry it with QtDesigner since there is no Designer Plugin in here...
If you have Visual Studio you must to do next steps (according to file "INSTALL"):
run console
change directory to directory where you installed QWT
type "qmake qwt.pro"
type "nmake"
You must be ensured that nmake.exe and qmake.exe in your PATH environment variable.
P.S. Easy way to add nmake.exe (its Visual Studio's make realization) is to run "tools/visual studio 2008 command prompt" from main menu of visual studio.

Resources