Qt in Visual Studio 2012
-
Hmm.. the ActivePerl and ActivePython installers should have updated the system PATH automatically. Try restarting your computer first; Windows won't see the updated PATH otherwise
-
[quote author="JKSH" date="1361142534"]Try restarting your computer first; Windows won't see the updated PATH otherwise[/quote]
That's actually no longer true starting from (I think)Vista. Win7/8 for sure. Just re-open a console and you're good to go.
I might be wrong, but from what I recall installers ask you if you want them to update your PATH and at least for one of them it was not the default.
Personally, if I can, I try not to pollute the global PATH and just include what I need on a per console session basis. All sort of crazy errors occur when there are conflicting things there (eg. git on windows is a very naughty piece of software). -
Guys and girls I would like to thank you because it runs !
On Windows 7 :
I downloaded Perl and Python 32 bits then the Qt source version 5.0
I created a folder C:\Qt\5.0.1 and put the zip file on it.
Unzipped it.Before starting the configuration you have to set your environmental variables to tell the system where you put Perl and Python. So :
Start > Right Click on Computer icon > Properties > Advanced System Settings > Advanced > Environment Variables > System Variables.
Select the variable "Path" and select "Edit". Do not delete what is written in this variable and add ";" (if not present) C:\Path to Perl.exe add another ";" C:\Path to Python.exe
Save and quit the dialog box.Then Start > Microsoft Visual Studio 2012 > Visual Studio Tools > Open VS2012 x64 Native Tools Command Prompt
First of all you have to change your folder with the command :
cd C:\Qt\5.0.1\qt-everywhere-opensource-src-5.0.1
Then type :
SET CL=/MP
Then type :
configure -developer-build -opensource -opengl desktop (-nomake tests -nomake examples)
The ones in brackets are optional - do not type in the brackets.
You should accept the license by entering "y".
After a while (2-3 minutes) type in:
qmake
It takes a very long time : about 3 hours (i7 - 2670QM@2,2 GHz).Then browse to Qt Project Website > Other Downloads and download Visual Studio Add-in 1.2.0 for Qt5 and run it.
Launch Visual Studio 2012. You should see Qt5 on the main bar. Select it and go to "Qt Options" > Add and enter a name for the version name and enter the path where you have qmake.exe (you should find it in the folder "bin". Save your selection.
You're now ready starting using Qt in VS 2012 !
That's All Folks !
-
Now tre trouble comes when I want to compile a Qt Project.
I've got a linkage error LNK 1112.
This is a conflict between 32 and 64 bits.How can I manage it ?
Thanks
-
I solved the issue by using VS 2012 x86 Native Tools Command Prompt instead.
-
Consider adding [SOLVED] in the post title
-
I checked this today, works fine for Windows 7 x64 Ultimate with VS 2012 x64 Ultimate. There is a small mistake in last point "After a while (2-3 minutes) type in: qmake" command prompt returned "no such command" and I had to use "nmake". Another tip :D form "http://qt-project.org/wiki/Building_Qt_Desktop_for_Windows_with_MSVC" after finishing build of all files run @nmake clean
cd qttranslations
nmake@ -
I'd like to suggest that these notes be formalized and displayed prominently in an article linked on the home page. I am a newcomer to Qt, but I am an experienced C++ programmer and I use VS 2012.
It seems to me that integration instructions for Microsoft's current development environment, as of April 2013, might rightfully be considered of paramount importance in terms of a "getting started on Windows" guide.
That way, a user who wishes to integrate Qt with Microsoft's most current IDE will not have to dig through forum postings, as I have had to do.
Thanks,
Dan -
Hey guys. I've been working on a community wiki on stackoverflow for this exact problem. It's certainly not perfect and I think needs some work from people who know more than I, but it's a start: http://stackoverflow.com/questions/15826893/getting-qt5-to-install-and-work-with-visual-studio-2012/15893226#15893226
-
I have carefully followed the steps to build Qt on Windows 7 64-bit (but building Qt in 32-bit mode) in the linked StackOverflow Community Wiki (see previous comment for link), but I cannot overcome the following error while running nmake:
"c1xx : fatal error C1083: Cannot open source file: '.rcc\debug_shared\qrc_mimetypes.cpp': No such file or directory."
(And, indeed, there is no "qrc_mimetypes.cpp" file anywhere in my Qt folder or its subfolders.)
I have posted a new StackOverflow question here: http://stackoverflow.com/questions/15932767/missing-qrc-mimetypes-cpp-while-attempting-to-build-qt-on-windows-7-32-bit-bu
Any help would be appreciated. It seems that building Qt on Windows is not straightforward, even when following all directions with meticulous care. Thanks!
-
I have resolved the problem to be a catastrophic bug with the Avast! antivirus sandbox. Only a complete uninstallation of Avast! suffices; as long as Avast! remains installed on the system, it is impossible under any circumstances to build Qt.
-
If it's a bug with Avast's sandboxing engine, then it needs to be fixed as it will probably frustrate many other users in the meantime. Please notify the Avast developers.
-
I have already alerted Avast. I sent them a detailed email this morning. Frankly, I suspect that their company (with 200,000,000 users) is now too top-heavy to care.
I will report here if and when they respond.
-
Great, thanks for your efforts :) Fingers crossed that they remember how they grew popular in the first place
-
Another VS2012 build issue, involving ICU support.
When ICU is enabled ("-icu" on the configure command line, along with a proper build of ICU in VS2012 and proper inclusion of all ICU paths (header, .lib, and .dll)), Line 688 of "qtbase\src\corelib\codecs\qtextcodec.cpp" returns a NULL codec (ICU fails to return a codec) when asked for a codec whose name is "US-ASCII".
Later, this NULL codec variable is dereferenced by the "lrelease.exe" utility when it attempts to perform a translation during the Qt build, which crashes lrelease.exe and causes the Qt build to stop with an error.
It therefore seems to be impossible to include ICU support with a VS2012-compiler 32-bit build of Qt5.
Might someone possibly be able to confirm and/or look into this?
-
I have posted this question to StackOverflow: http://stackoverflow.com/questions/15975608/icu-support-in-a-32-bit-build-of-qt5-with-the-vs2012-compiler-causes-qt5-build-f
-
Note the further, related issue that this means that Webkit cannot be built for VS2012, either, since Webkit requires an ICU build of Qt.