Saturday, December 1, 2012

Compiling Qt for visual studio 2012 - windows 8

Download Qt 4.8.4 from here
Download Perl from here
Download JOM from ftp://ftp.qt.nokia.com/jom/jom.zip

1. Install Perl, which we downloaded


2. Extract the Qt src file (zip file) to C:/Qt


3. Qt 4.8.4 has problem compiling the webkit module so we have to replace
C:\Qt\src\3rdparty\webkit\Source\JavaScriptCore\wtf\HashSet.h with this HashSet.h 
4. Extract JOM to C:/Qt/jom

5. Set up the environment variables for Qt

QTDIR=C:\Qt\QMAKESPEC=win32-msvc2012
6. Update PATH variable to  %QTDIR%\bin
add ';' to the end of the path and then append %QTDIR%\bin

7.Open VS2012 Native tools command line and move to C:\Qt

cd C:\Qt
8.Then type 
configure -opensource -platform win32-msvc2012
9. Then type
jom\jom.exe -j n
where n is the number of cores of your CPU.For me its ( jom\jom.exe -j 2 )

Compilation usually takes 5 - 6 hours 

8 comments:

  1. Thank you, it helps me very much.

    ReplyDelete
  2. Thank you very much, that's greate help.

    ReplyDelete
  3. It's an remarkable piece of writing for all the web visitors; they will obtain advantage from it I am sure.

    my web site; racing games

    ReplyDelete
  4. with the same steps i got this error when compiling

    C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(103) : error C2491: 'round' : definition of dllimport function not allowed
    C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(110) : error C2491: 'roundf' : definition of dllimport function not allowed
    C:\Qt\4.8.5.src\src\3rdparty\javascriptcore\JavaScriptCore\wtf/MathExtras.h(128) : error C2084: function 'bool signbit(double)' already has a body
    C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\math.h(324) : see previous definition of 'signbit'
    c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(615) : error C2264: 'signbit' : error in function definition or declaration; function not called
    c:\qt\4.8.5.src\src\3rdparty\javascriptcore\javascriptcore\runtime\JSValue.h(696) : error C2264: 'signbit' : error in function definition or declaration; function not called

    ReplyDelete
  5. You are trying to compile Qt 4.8.5 which is not compatible with VS2012 => Please take more attention of what is written.

    ReplyDelete
  6. Juѕt wаnt to saу your article is as surpriѕing.
    The clarity to your put up is јust nіce
    and i could think уou're knowledgeable in this subject. Well along with your permission allow me to grab your RSS feed to keep up to date with forthcoming post. Thanks a million and please continue the rewarding work.

    Feel free to surf to my website ... media temple vps

    ReplyDelete
  7. Great and that i have a dandy provide: Who Repairs House Windows Near Me house renovation permit

    ReplyDelete