Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Building Qt 4.8.2 with Visual Studio 2012 RC
Forum Updated to NodeBB v4.3 + New Features

Building Qt 4.8.2 with Visual Studio 2012 RC

Scheduled Pinned Locked Moved Installation and Deployment
16 Posts 9 Posters 21.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nosf
    wrote on last edited by
    #5

    Am in two minds about which fix to pick. Guess both solve this issue currently, however I see in

    patrick_g 's fix

    @
    inline pair<typename HashSet<T,U,V>::const_iterator, bool> HashSet<T,U,V>::add(const ValueType
    @

    while the first fix has the original format of just iterator than HashSet<T,U,V>::const_iterator

    Does this not matter?

    1 Reply Last reply
    0
    • F Offline
      F Offline
      FloGe
      wrote on last edited by
      #6

      I'm using alzi's fix to compile Qt 4.8.2 with Visual Studio 2012 RTM. It works so far, thanks!

      1 Reply Last reply
      0
      • P Offline
        P Offline
        paolo_dc
        wrote on last edited by
        #7

        Hello,
        A little up to this post.
        I've followed http://rritw.com/a/JAVAbiancheng/ANT/20120630/178737.html post to compile Qt 4.8.2 for visual studio 2012.
        At step 6, we have to deal with the error in wtf/hashset.h. I fixed it as alzi said. But I can't still compile qt. I have still this error :(

        @.\wtf/HashSet.h(180) : error C2664: 'std::pair<_Ty1,_Ty2>::pair(const std::pair<
        _Ty1,_Ty2> &)' : impossible de convertir le paramètre 1 de 'std::pair<_Ty1,_Ty2>
        ' en 'const std::pair<_Ty1,_Ty2> &'
        with
        [
        _Ty1=WTF::HashTableConstIteratorAdapter<WTF::HashTable<void *,void *
        ,WTF::IdentityExtractor<void *>,WTF::PtrHash<void *>,WTF::HashTraits<void *>,WTF
        ::HashTraits<void *>>,void *>,
        _Ty2=bool
        ]
        and
        [
        _Ty1=WTF::HashTableIterator<void *,void *,WTF::IdentityExtractor<voi
        d *>,WTF::PtrHash<void *>,WTF::HashTraits<void *>,WTF::HashTraits<void *>>,
        _Ty2=bool
        ]
        and
        [
        _Ty1=WTF::HashTableConstIteratorAdapter<WTF::HashTable<void *,void *
        ,WTF::IdentityExtractor<void *>,WTF::PtrHash<void *>,WTF::HashTraits<void *>,WTF
        ::HashTraits<void *>>,void *>,
        _Ty2=bool
        ]
        Raison : impossible de convertir de 'std::pair<_Ty1,_Ty2>' en 'const std
        ::pair<_Ty1,_Ty2>'
        with
        [
        _Ty1=WTF::HashTableIterator<void *,void *,WTF::IdentityExtractor<voi
        d *>,WTF::PtrHash<void *>,WTF::HashTraits<void *>,WTF::HashTraits<void *>>,
        _Ty2=bool
        ]
        and
        [
        _Ty1=WTF::HashTableConstIteratorAdapter<WTF::HashTable<void *,void *
        ,WTF::IdentityExtractor<void *>,WTF::PtrHash<void *>,WTF::HashTraits<void *>,WTF
        ::HashTraits<void *>>,void *>,
        _Ty2=bool
        ]
        Aucun opérateur de conversion définie par l'utilisateur disponible qui p
        uisse effectuer cette conversion, ou l'opérateur ne peut pas être appelé
        .\wtf/HashSet.h(179) : lors de la compilation de la fonction membre 'std
        ::pair<_Ty1,_Ty2> WTF::HashSet<ValueArg>::add(void *const &)' de la classe modèl
        e
        with
        [
        _Ty1=WTF::HashTableConstIteratorAdapter<WTF::HashTable<void *,void *
        ,WTF::IdentityExtractor<void *>,WTF::PtrHash<void *>,WTF::HashTraits<void *>,WTF
        ::HashTraits<void *>>,void *>,
        _Ty2=bool,
        ValueArg=void *
        ]
        heap\MarkStack.h(74) : voir la référence à l'instanciation de la fonctio
        n modèle 'std::pair<_Ty1,_Ty2> WTF::HashSet<ValueArg>::add(void *const &)' en co
        urs de compilation
        with
        [
        _Ty1=WTF::HashTableConstIteratorAdapter<WTF::HashTable<void *,void *
        ,WTF::IdentityExtractor<void *>,WTF::PtrHash<void *>,WTF::HashTraits<void *>,WTF
        ::HashTraits<void *>>,void *>,
        _Ty2=bool,
        ValueArg=void *
        ]
        heap\MarkStack.h(195) : voir la référence à l'instanciation de la classe
        modèle 'WTF::HashSet<ValueArg>' en cours de compilation
        with
        [
        ValueArg=void *
        ]
        NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
        \VC\BIN\cl.EXE"' : code retour '0x2'
        Stop.
        NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0
        \VC\BIN\nmake.exe"' : code retour '0x2'
        Stop.
        NMAKE : fatal error U1077: 'cd' : code retour '0x2'
        Stop.
        NMAKE : fatal error U1077: 'cd' : code retour '0x2'
        Stop.@

        My hashset.h modification are :
        @ template<typename T, typename U, typename V>
        inline pair<typename HashSet<T, U, V>::iterator, bool> HashSet<T, U, V>::add(const ValueType& value)
        {
        typedef typename HashSet<T, U, V>::iterator iter_type;
        auto& temp = m_impl.add(value);
        return make_pair((iter_type)temp.first, temp.second);
        }

        template<typename Value, typename HashFunctions, typename Traits>
        template<typename T, typename HashTranslator>
        inline pair<typename HashSet<Value, HashFunctions, Traits>::iterator, bool>
        HashSet<Value, HashFunctions, Traits>::add(const T& value)
        {
            typedef HashSetTranslatorAdapter<ValueType, ValueTraits, T, HashTranslator> Adapter;
            typedef typename HashSet<Value, HashFunctions, Traits>::iterator iter_type;
            auto& temp = m_impl.template addPassingHashCode<T, T, Adapter>(value, value);
            return make_pair((iter_type)temp.first, temp.second);
        }@
        

        What am I doing wrong?
        Can you help me please?

        Paolo

        1 Reply Last reply
        0
        • F Offline
          F Offline
          FloGe
          wrote on last edited by
          #8

          I posted it on PasteBin.

          http://pastebin.com/kiXrcwx9

          What you posted looked to me 100% like the same I have.

          1 Reply Last reply
          0
          • P Offline
            P Offline
            paolo_dc
            wrote on last edited by
            #9

            Thanks Floge,

            Yeah :( I don't know why it doesn't want to compile with me. I'll try with your hashset.h.

            1 Reply Last reply
            0
            • P Offline
              P Offline
              paolo_dc
              wrote on last edited by
              #10

              Ok, so I've still got this stupid error.
              I can't compile all the qt project with vs2012:/
              I've configure the compiliation without the webtoolkit (I don't need it in fact) and it works now

              Thanks again Floge!

              Paolo

              1 Reply Last reply
              0
              • F Offline
                F Offline
                FloGe
                wrote on last edited by
                #11

                patrick_g's patch also works with Qt 4.8.3, no idea why it isn't "in" yet tho

                oh well, what to expect when there is still no official win32-msvc2012 target available, leave alone win32-msvc2012_xp

                1 Reply Last reply
                0
                • F Offline
                  F Offline
                  FloGe
                  wrote on last edited by
                  #12

                  Qt 4.8.4 now has an official win32-msvc2012 target.

                  But this fix has yet to be patched in.

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    lschlegel
                    wrote on last edited by
                    #13

                    I had the same issue building Qt 4.8.4 on win32-msvc2012.

                    I would like to add to the discussion that there are actually two versions of the HashSet.h file:
                    The one that causes the problem is src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h.

                    The other version of the file is src/3rdparty/javascriptcore/JavaScriptCore/wtf/HashSet.h. Its add methods look like this:

                    @
                    template<typename T, typename U, typename V>
                    pair<typename HashSet<T, U, V>::iterator, bool> HashSet<T, U, V>::add(const ValueType& value)
                    {
                    pair<typename HashTable<T, T, IdentityExtractor<T>, U, V, V>::iterator, bool> p = m_impl.add(value);
                    typename HashSet<T, U, V>::iterator temp = p.first;
                    pair<typename HashSet<T, U, V>::iterator, bool> p2 = pair<typename HashSet<T, U, V>::iterator, bool>(temp, p.second);
                    // p2.first = p.first;
                    // p2.second = p.second;
                    return p2;
                    }

                    template<typename Value, typename HashFunctions, typename Traits>
                    template<typename T, typename HashTranslator>
                    pair<typename HashSet<Value, HashFunctions, Traits>::iterator, bool>
                    HashSet<Value, HashFunctions, Traits>::add(const T& value)
                    {
                    typedef HashSetTranslatorAdapter<ValueType, ValueTraits, T, HashTranslator> Adapter;
                    pair<typename HashTableType::iterator, bool> p = m_impl.template addPassingHashCode<T, T, Adapter>(value, value);
                    return pair<iterator, bool>(p.first, p.second);
                    }
                    @

                    They were obviously taken from two different versions of the WebKit project.

                    1 Reply Last reply
                    0
                    • J Offline
                      J Offline
                      justDance
                      wrote on last edited by
                      #14

                      I followed http://stackoverflow.com/questions/12113400/compiling-qt-4-8-x-for-visual-studio-2012/14928303#14928303 to build Qt 4.8.4 specifically for VS2012, but got link error: qtmaind.lib(qtmain_win.obj) : error LNK2038: mismatch detected for ‘_MSC_VER’: value ‘1600’ doesn’t match value ‘1700’ in main.obj

                      I tried two options:

                      1. use command
                        configure -mp -opensource -nomake demos -nomake examples -platform win32-msvc2012
                        and 2) Go to mkspecs\win32-msvc2010. Open qmake.conf and change:
                        QMAKE_COMPILER_DEFINES += _MSC_VER=1600 WIN32
                        to:
                        QMAKE_COMPILER_DEFINES += _MSC_VER=1700 WIN32
                        then use command configure -mp -opensource -nomake demos -nomake examples -platform win32-msvc2010
                        both gave me the same error.

                      I checked configure.cache under my qt folder, it is showing: -platform win32-msvc2012

                      Does anybody know what is wrong here? Thanks

                      1 Reply Last reply
                      0
                      • F Offline
                        F Offline
                        FloGe
                        wrote on last edited by
                        #15

                        [quote author="justDance" date="1361163855"]I followed http://stackoverflow.com/questions/12113400/compiling-qt-4-8-x-for-visual-studio-2012/14928303#14928303 to build Qt 4.8.4 specifically for VS2012, but got link error: qtmaind.lib(qtmain_win.obj) : error LNK2038: mismatch detected for ‘_MSC_VER’: value ‘1600’ doesn’t match value ‘1700’ in main.obj

                        I tried two options:

                        1. use command
                          configure -mp -opensource -nomake demos -nomake examples -platform win32-msvc2012
                          and 2) Go to mkspecs\win32-msvc2010. Open qmake.conf and change:
                          QMAKE_COMPILER_DEFINES += _MSC_VER=1600 WIN32
                          to:
                          QMAKE_COMPILER_DEFINES += _MSC_VER=1700 WIN32
                          then use command configure -mp -opensource -nomake demos -nomake examples -platform win32-msvc2010
                          both gave me the same error.

                        I checked configure.cache under my qt folder, it is showing: -platform win32-msvc2012

                        Does anybody know what is wrong here? Thanks[/quote]

                        While figuring out the correct way to compile, you might have prematurely compiled some parts with the MSC 1600 settings (either a qtmain_win.cpp or a main.cpp).

                        Try the following:

                        nmake clean
                        nmake confclean

                        Decide whether you want to use the win32-msvc2012 or the modified win32-msvc2010 mkspec. Both should work, but you should pick only one.

                        Then check the mkspec file you want to use is set up correctly, run configure one time, then do an nmake.

                        Each time you want to change something with the configuration you should do an nmake clean & nmake confclean first, or to be absolutely safe, start each time from a fresh unpacked source zip.

                        1 Reply Last reply
                        0
                        • C Offline
                          C Offline
                          cboos
                          wrote on last edited by
                          #16

                          This problem (the original HashSet.h one) is tracked in "QTBUG-28335":https://bugreports.qt-project.org/browse/QTBUG-28335

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved