Compiling Qt codes for different versions using Visual Studio 2012



  • Hi,
    I m compiling Qt application code using Visual Studio 2012 with the help of Qt5 Visual studio Add-in 1.2.2.
    For compiling 64-bit i m using Qt5.0.1 library files and for compiling 32-bit application, i m using Qt 4.8.6 library files.
    I'm able to compile 32-bit application successfully. When i m trying to compile 64-bit application, Following errors encountered:

    "This file was generated using the moc from 4.8.6. It cannot be used with the include files from this version of Qt. The moc has changed too much"

    Why i m facing such errors ? is it possible to have different version of Qt Library files to compile qt application binaries ?
    How to troubleshoot this problem ?

    Kindly help me

    Thank You



  • You need to clean old build and re-run qmake and make.
    Another option would be to use separate directories for each build. One for 64 and another for 32.



  • Or maybe set different MOC_DIR for each version.
    You might also want to set ALL possible directory to a different value for each builds (OBJECTS_DIR, RCC_DIR, UI_DIR).


  • Lifetime Qt Champion

    Hi,

    @sandy.martel: it's not a question of changing the output dirs, the correct version of moc must be run thus, Raveendra must ensure that the correct version of qmake is used when building in 64bit since it uses Qt 5.

    @Raveendra: One thing is puzzling me, why are you using two different series of Qt since the only difference between your builds seems to be the architecture ?



  • we have some requirement to use qt4.8 because it uses less size binaries to run the application.

    Is there any way to change the qmake version for moc ing using visual studio commands ?

    We use only visual studio to build the qt application with the help of qt visual studio add-in.


Log in to reply
 

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