Qt5.4.2 build with MSVC 2008 on Windows 7 - 64bit



  • Hi Everyone,

    For the past couple of days I have been trying to build Qt5.4.2 with MSVC 2008 on Windows 7 64bit platform without success. My goal is to build Qt and then build QtWebKit in order to use the web browser engine provided. I'm building a 32-bit version of Qt.

    My setup:
    1- I have downloaded the Qt5.4.2 zip package and extracted the contents to: C:\Qt\Qt5.4.2_source

    2- Installed Perl (C:\Perl), Python(C:\Python34) and Ruby(C:\Ruby21). They are added to the PATH variable.

    3- Built ICU with MSVC 2008 (C:\icu).

    4- Opened a MSVC 2008 command prompt. Ran the batch file vcvarsall.bat with x86 argument as follow:
    "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
    NOTE: this might have been unnecessary as I have opened a VC9 command prompt but I did it anyway just in-case.

    5- Set the following variables in VC9 command prompt:
    SET PATH=C:\Qt\Qt5.4.2_source\qtbase\bin;C:\Qt\Qt5.4.2_source\gnuwin32\bin;%PATH%
    SET QMAKESPEC=win32-msvc2008
    SET PATH=%PATH%;C:\icu\dist\bin;C:\icu\dist\lib
    SET LIB=%LIB%;C:\icu\dist\lib
    SET INCLUDE=%INCLUDE%;C:\icu\dist\include

    6- Run configure as this:
    configure -prefix %CD%\qtbase -opensource -icu -opengl desktop -nomake tests

    7- run nmake.

    After about two hours I get the following errors:

    camera\dscamerasession.cpp(98) : error C2664: 'InterlockedIncrement' : cannot co
    nvert parameter 1 from 'ULONG *' to 'volatile LONG *'
    Types pointed to are unrelated; conversion requires reinterpret_cast, C-
    style cast or function-style cast
    camera\dscamerasession.cpp(103) : error C2664: 'InterlockedDecrement' : cannot c
    onvert parameter 1 from 'ULONG *' to 'volatile LONG *'
    Types pointed to are unrelated; conversion requires reinterpret_cast, C-
    style cast or function-style cast
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0
    VC\BIN\cl.EXE"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0
    VC\BIN\nmake.exe"' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.
    NMAKE : fatal error U1077: 'cd' : return code '0x2'
    Stop.

    Now I have spent some time Google-ing this issue and found out that some other people have been experiencing the same issue. Some suggested to modify the dscamerasession.cpp with a reinterpret_cast to resolve the compile error. [Link can be found here https://forum.qt.io/topic/48381/qt-5-with-visual-studio-2008-crash-on-compile-dscamerasession-cpp]
    While I know this would fix the compile error I do not want to do it as I'm pretty confident Qt code is correct and should be working with MSVC 2008, and the fact I'm getting this error means something is not setup correctly on my system.

    I would really appreciate if anyone can shed some light on this issue and point me in the right direction.
    Just to add another note, I have tried to use jom (C:\Qt\jom) to build with command:
    C:\Qt\Qt5.4.2_source\ ..\jom\jom.exe -j 4
    For some reason this seems to compile fine without any issues which has totally baffled me. Note that except the jom difference everything else has been kept the same.

    Many thanks


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.