Qt, Visual Studio 2017 and .vcxproj.user Files - qt

I am using Visual Studio 15.9.14 and Qt 5.13.0 on multiple machines. When I check out my source from version control:
If I open the VS IDE to build my solutions, everything compiles and links correctly.
If I build the solutions from the command line using devenv.exe, there are multiple compile and link errors in the Qt projects.
The problem is that when building from the command line, the .vcxproj.user files are NOT generated, and therefore $QTDIR is not defined for use in my projects. The result is my automated/nightly builds fail.
I can build a tool to create the files and integrate it into my build process, but I shouldn't have to. This problem seems to be related to the VS/Qt integration. I have also encountered a similar problem in the IDE where I had to force the files to regenerate by touching the projects.
Any suggestions/help would be appreciated.

Related

How can I build/compile Qt installer fromwork from source?

I have to build Qt installer framework from source because of this problem that is mentioned here
Qt Installer Framework - Removing the Maintenance Tool
Based on this answer, this is the only way to solve my issue. Although I attempted to build it, I encountered several linker issues. I've read the documents in the zip folder, and now I'm not sure if I followed the right procedures. I am wondering if there is any tutorial or instruction for compiling IFW from source.

Deploying Qt C++ Application from Visual Studio qwindows.dll error

I've been googling for a solution to this issue and although I've found many people sharing my problem none of their solutions work for me.
I wrote a C++ application using Qt framework using Visual Studio 2010. I built and ran the application in "Release" mode from Visual Studio without issue, but when I copy that exe from the Release folder to a new destination (pretend its a new PC) it fails to run providing this error:
---------------------------
TestApplication
---------------------------
This application failed to start because it could not find or load the Qt platform plugin "windows".
Available platform plugins are: windows.
Reinstalling the application may fix this problem.
Within the executable directory I have the following file structure:
./TestApplication.exe
./libGLESv2.dll
./Qt5Core.dll
./Qt5Gui.dll
./QtWidgets.dll
./platforms/qwindows.dll
./qt.conf
All dll files were taken from the 5.0.0 build of Qt in the Qtbase folder where the libraries reside.
The qt.conf file is:
[Paths]
Plugins=.
Without it, the launch error is the same except it says "minimal" and "offscreen" are available platforms as well.
For all other people experiencing this error it seemed to be solved by creating the platforms folder and putting in the qwindows.dll. But doing that myself doesn't change any behavior.
Is there something I've done wrong? Perhaps my method of generating the .exe in the first place is wrong?
If you are using libGLESv2.dll, then you must include libEGL.dll, too.
You can't see that in depends.exe, don't know how the Qt developers managed to hide this.
If your Qt is out of the box, then both Dlls are necessary even if you are not using OpenGL.
Also, if your Qt is out of the box, you need to include also the three ic*.dll, which contain information for Unicode handling.
You can see which DLLs are needed by looking at which ones are invoked when running Debug (F5) in Qt Creator.
=Carl
The release is likely missing a library/plugin or the library is in the wrong directory and or from the wrong directory.
Qt intended answer: Use windeployqt.
Qt comes with platform console applications that will add all dependencies (including ones like qwindows.dll and libEGL.dll) into the folder of your deployed executable. This is the intended way to deploy your application, so you do not miss any libraries (which is the main issue with all of these answers). The application for windows is called windeployqt. There is likely a deployment console app for each OS.

Compiling QT 5.0

I want to compile QT 5.0 similar to the package that is offer on http://qt-project.org/downloads for Visual Studio 2012.
I followed these instructions http://qt-project.org/wiki/Building-Qt-5-from-Git and they work pretty well, only problem is, if I rename the folder where I compiled QT (or move the folder someplace else), Visual Studio starts complaining when I try to build a QT Application, that it does not find debug information or platform is missing, is like somehow the compilation files embedded the full path inside them to look for dependencies instead of been relative paths.
The reasons I do not use the package provided for VS in the website is because I also need an x86 version of it.
Another problem I am facing is that the compilation folder has thousands of files that takes a long time to move or delete, in the package from the website there are not so many files.
Does anyone know what options I have to give QT when compiling it the first time?
I use “-debug_and_release -c++11 -opensource -nomake examples -nomake tests”
Thanks!
On VS there should be Qt5 menu. There must be something like Qt Options. From the Versions tab you must add the new path as a new version and probably remove the old path because it does not exist anymore. Probably you will also need to change the project's Qt version from the project's context menu. I don't have VS in front of me but according to my visual memory this should do the trick.

How to get QtCreator to link incrementally with nmake?

I used to develop in Visual Studio (2008) but almost completely switched to developing in QtCreator now, mainly due to Code Navigation, refactoring and Code Completion.
I'm using the win32-msvc2008 mkspec. So far I've managed to set up everything except for one thing:
Incremental Linking.
In my project file I added the line:
QMAKE_LFLAGS += /INCREMENTAL
and I get a linker line like
link /LIBPATH:"(...)" /NOLOGO /INCREMENTAL /DEBUG /MANIFEST (...)
However, it always tells me it cannot find the .exe or it was not built completely by the last incremental build, even if I only change a .cpp file, revert the change and save.
I've tried building with and without shadow build, and with nmake or jom, neither combination works.
Has anyone managed to get QtCreator to link incrementally with nmake?
PS: If I import the project file into Visual Studio using the Qt Plugin, incremental linking works perfectly.
Apparently qmake needs to generate the makefiles differently in order to make incremental linking work properly when you are using nmake.
I filed a bug request, if you're interested, here it is: https://bugreports.qt-project.org/browse/QTBUG-22718

How is FlexBuilder compiling my app?

I'd like to see the command-line arguments that FlexBuilder is using to compile my application. This is so that I can build them into the ANT script I'm working on. Is there any way to view the command line compilation step?
The reason I'm asking for this is that when I compile my app using Ant/Flex SDK vs. FlexBuilder my app behaves differently.
So I figured out the answer.
First of all, you can get a better idea of how FlexBuilder compiles your app by adding a -dump-config=C:\myConfig.xml to the compile arguments in FlexBuilder. This outputs an xml file containing configuration settings used in the compilation step. You can also use this file as an argument to compc or mxmlc if you'd like. Read more about it
here...
But, here's what actually solved my problem. I was using the regular old Flex SDK installed on our integration server to compile my apps using Ant. This is the free SDK you can download from Adobe's site. I then took the FlexBuilder directory from my local machine and copied it up to the integration server and pointed my build script to use that version of the SDK (and changed my path env variable).
When I compiled using the FlexBuilder version of the SDK, all was well and the strange bugs I was seeing in my app disappeared.
Moral of the story, make sure you are using the same version of the SDK for your automated builds as you use to build locally.

Resources