Using Qt 5 with VS 2012 Express, and managing different QTDIR
I am currently using VS 2012 Express for development and have recently installed Qt5.2 ( for MinGW and all versions of msvc2010/2012 ). I have a 32-bit library for which I want to use Qt to write a Tool App for, and I'm wondering if anyone has any luck compiling a Qt5 project in VS 2012 Express.
As far as I know, VS 2012 Express can't use the VS 2012 Plugin. I created a project for an 32-bit msvc2012 App with QtCreate. I also managed to create a VS2012 project by adding “–tp vc” in Build Step > qmake.
Using the generated .vcxproj file, I can compile the exe. When I try to run it, either directly or with the Local Windows Debugger, an error regarding a missing .dll will appear, one which is under C:\Qt\5.2.0\msvc2012\bin.
I managed to get around this issue using one of the following two methods:
- Copy all the dlls in C:\Qt\5.2.0\msvc2012\bin to the same folder with the .exe.
- Add “C:\Qt\5.2.0\msvc2012\bin” to the Environment Variable $Path.
Most of the solutions I found online suggested using the second method. I am worried, however, if this will become a problem when I want to have another Qt project that uses a different setting of compilers and binaries (e.g. if I want to compile a 64-bit app, or if I need to use openGL).
Is there a better way to manage the usage between different binary versions of Qt5?
Thank you for any help in advance.